Star Sphere with Scalable Stars
Version 2.0 - August 18, 2006
Star Sphere with Scalable Stars, Version 2.0 is a revision to a
project that was originally released on December 22, 2004. Details on
how version 1 was created can be found in this thread
in the Hash forums. In version 1, the stars that made up the sphere had
random sizes to vary their brightness, but the difference introduced in
version 2 is that the stars are now all the same size, but vary in
transparency.
These files were created in Animation:Master
version 12.0w, and should be forward-compatible with version 13.0
(however, resaving the files under 13.0 and later will make them
incompatible with 12.0 and earlier.) Because the files do not use any
features unique to 12.0, they should be compatible with versions 10 and
11, but this has not been tested. The use of expressions prevents these
files from working in version 9 or earlier.
Contents
This folder contains the following files:
- StarSphereV2.mdl
- This star sphere model with scalable stars consists of 2048
circular patches, each of which is 15 meters in diameter, arranged
randomly to form a spherical shell 10000 meters in radius, and oriented
so that their normals point toward the origin. Each patch is assigned
to a 15 meter long hidden bone which coincides with the normal of the
patch. A pose slider called "Star size in meters" scales all the bones
in the X and Y axes so that the size of the stars ranges from 0 to 30
meters; the default is 15 meters. The entire model is white with 100%
ambiance, but the StarSphereV2_Replicate_varTransp.act action file
creates variations in transparency with each duplicated action object
to simulate stars with varying brightness.
- StarSphereV2_Replicate_varTransp.act
- An action for StarSphereV2.mdl that creates 15 duplicates of
itself as action objects. (Note that beginning in A:M version 11.1g, it
is not possible to duplicate an object as its own action object by
dragging the object into its own action, but it is possible to create
such an action file by editing it in a text editor.) The transparency
of the action objects is set to approximate a normal (bell curve)
distribution:
- one duplicate is 12.5% transparent,
- two duplicates are 25% transparent,
- three duplicates are 37.5% transparent,
- three duplicates are 50% transparent,
- three duplicates are 62.5% transparent,
- two duplicates are 75% transparent, and
- one duplicate is 87.5% transparent.
The duplicates all have different orientations and are
reflected across different combinations of axes. An expression applied
to each duplicate sets the value of its "Star size in meters" pose
slider to the same value as the slider in the parent object. With this
action applied, the total number of stars is 32768. The transparent
stars allow backdrops to be placed behind the star sphere, such as a
sheet of patches with 100% ambiance decaled with an image of a nebula.
- StarSphereV2_scalable.cho
- This choreography contains StarSphereV2.mdl with
StarSphereV2_Replicate_varTransp.act applied to it, as well as an
embedded sun light with 100% shadow darkness, and a camera with a 35 mm
focal length and a black background, rendering at 640x480 resolution.
The star size is set to the default value of 15 m. Because of the
large number of bones in the scalable star sphere and its duplicates,
this choreography may take several minutes to open, depending on the
CPU speed of your computer.
- StarSphereV2-Fixed05m.mdl,
StarSphereV2-Fixed08m.mdl, StarSphereV2-Fixed10m.mdl,
StarSphereV2-Fixed12m.mdl, StarSphereV2-Fixed15m.mdl
- These versions of the star sphere model have non-scalable
stars fixed at a size of 5, 8, 10, 12 and 15 meters respectively. All
bones and the pose slider have been removed, which makes them load much
faster in a choreography than the scalable model.
- StarSphereV2-Fixed_Replicate_varTransp.act
- By default, this action is applied to StarSphereV2-15m.mdl and
creates 15 duplicates of it with the same orientations and
transparencies as in the scalable version. Using this file with the
other fixed star models requires editing with a text editor (see below).
- StarSphereV2_fixed.cho
- By default, this choreography contains StarSphere-15m.mdl with
StarSphereV2-Fixed_Replicate_varTransp.act applied to it, and the same
sun light and camera as StarSphereV2_scalable.cho.
Using the scalable star sphere
The purpose of these files is to allow fast rendering of space (or
night sky) scenes in which the stars occupy approximately one pixel in
the frame. The size of the stars can be adjusted to account for the
zoom setting of the camera and the resolution of the render. The "Star
size in meters" pose slider in StarSphereV2.mdl has a range of 0 to 30
with a default of 15 -- you can ignore the percent symbol in the slider
value, because this value is not actually a scaling percentage.
Version 2, in which all the stars are the same size, was created
in an attempt to deal with the problems of small stars flickering when
they move. For rendering a single still frame, the star size, camera
length and resolution can be set using the method below so that the
stars appear to be one pixel on the image. However, when rendering an
animation, it may be necessary to use larger stars to prevent
flickering.
Here's how to determine which star size setting will produce one-pixel stars:
The relationship between the focal length and the field of view in an
A:M camera is based on the camera having a horizontal aperture of 35
mm. We will assume that a camera (shown below in light gray) with focal
length f, producing renders with a maximum dimension of W pixels, is located at the center of a star sphere with radius R. Angle A is the camera's field of view, which can be derived from angle B, formed within the camera by the focal length and half the horizontal aperture (35 mm / 2 = 17.5 mm). Angle C is the angle subtended by one star (shown in yellow). The size s that the star needs to be in order to appear as one pixel may be derived by this method:
Since R = 10000 m in this model, the following values of s in meters (shown in bold) may be obtained by plugging the given camera settings into Equation (2). (A, the field of view, is obtained from Equation (1)):
Focal length (f) |
Field of view (A) |
Resolution (W) in pixels |
| 320 |
640 |
720 |
800 |
1024 |
1280 |
1920 |
| 30 mm |
60.51° |
33.00 |
16.50 |
14.67 |
13.20 |
10.31 |
8.25 |
5.50 |
| 35 mm |
53.13° |
28.98 |
14.49 |
12.88 |
11.59 |
9.06 |
7.24 |
4.83 |
| 50 mm |
38.58° |
21.04 |
10.52 |
9.35 |
8.42 |
6.58 |
5.26 |
3.51 |
| 70 mm |
28.07° |
15.31 |
7.66 |
6.80 |
6.12 |
4.78 |
3.83 |
2.55 |
| 100 mm |
19.85° |
10.83 |
5.41 |
4.81 |
4.33 |
3.38 |
2.71 |
1.80 |
Apply Equation (2) directly to obtain star size values for camera settings not covered by this table. The resolution, W,
is the largest dimension of the rendered frame, so if you're rendering
in portrait format instead of landscape, you should consider W to be the height instead of the width.
Another advantage of the scalable star
sphere is the ability to animate the star size to stay in sync with the
animation of the camera's focal length. If the camera will be making a
zoom move in the course of the choreography, you will need to keyframe
the "Star size in meters" pose slider on the same frames as the
keyframes you set for the beginning and end of the zoom. The new value
of the pose slider at the end of the zoom will need to be calculated
using Equation (2) or the table, based on the new focal length.
If the camera will be moving a considerable
distance away from the center of the star sphere during the
choreography, as it approaches the edge of the sphere it will become
apparent that some of the stars are closer to the camera, and therefore
brighter, than others. You can remedy this either by constraining the
star sphere to translate to the camera, or by scaling up the entire
star sphere choreography shortcut from its model bone. It will also be
necessary to scale up the star sphere if the objects included in the
scene are too big to fit into the existing volume. Scaling the star
sphere will not affect the angular size of the stars as seen from the
center, and the replicated action objects will follow the translation
and scaling of the parent object.
Fixed-size star spheres are best suited for
applications where you don't expect to be animating the camera's focal
length, and you can't afford to wait for the scalable star sphere to
load. Consult Equation (2) and the table above to determine which star size is best suited for your camera's settings.
A choreography and a replication action are
provided using the sphere with 15-meter stars. If you want to use the
choreography and action with a different fixed-size sphere, you can
edit them by following these steps:
- Open StarSphereV2-Fixed_Replicate_varTransp.act in a text editor.
- Search for "StarSphereV2-Fixed15m.mdl" and replace all instances of it with the filename of the sphere you want to use.
- Save the action file with the same name. (Make sure the extension is .act and not .txt.)
- Open StarSphereV2_fixed.cho in A:M.
- In the Project Workspace, expand the choreography and select Shortcut to StarSphereV2-Fixed15m.
- In its "Shortcut To" property, click on StarSphereV2-Fixed15m and choose the new star sphere from the pull-down menu.
If none of the included fixed-size spheres have the
right star size for your needs, you can create a new fixed-size sphere
yourself:
- Create a new action in A:M and edit it using the scalable star sphere (StarSphereV2.mdl).
- Set the "Star size in meters" pose slider to the desired size.
- Right-click (Ctrl-click on a Mac) on the
action in the Project Workspace, select Export > Model (*.MDL), and
save the model under a new name; this may take some time.
- Close the action and open the model you just created.
- Expand it using its + button in the PWS.
- Select the Bones and Relationships folders and delete them.
- View the Properties of the model, either in
the Properties pane or by expanding the Properties triangle (if you
have enabled that in A:M's customization panel).
- At the bottom of the Properties list, expand User Properties.
- Right-click (Ctrl-click on a Mac) on the
"Star size in meters" pose, and select Delete from the contextual menu.
Press "Yes" in the confirmation dialog.
- Save the model.
The star sphere concept was inspired by a model by
Carmen Rizzolo. Grateful acknowledgement is made to Yves Poissant and
Anders Averö for their valuable programming advice, and to Joel
Steudler for ideas that led to the development of version 2.