Scenegraph Palettes

Palettes are the basic elements of the Shockwave 3D§ scenegraph, collecting all sharable assets in a Shockwave 3D scene. An entry in an asset's palette contains basic information about that asset, as well as pointers to other palettes or resources that fully describe the asset.

Assets are added to and retrieved from palettes by name. Querying a palette with a name returns a palette ID, which is essentially the asset's index in the queried palette. This ID can then be used to perform other operations, such as adding or recovering resources used by the asset.

Every palette contains a default entry at ID 0. In the Node Hierarchy Palette, for example, this is the scene root. In the Shader Resource Palette, for example, this entry represents the default surface properties of a model.

Scenegraph Node Palette

Each entry in this palette captures Shockwave 3D scene hierarchy information. Only objects derived from IFXNode are included. These include:

Each node specifies its parent, its type (light, view, model, group), and its local transformation matrix.

The node hierarchy palette also stores the node's resource palette ID (with the exception of group nodes and camera nodes, which only exist in the node hierarchy palette), and contains pointers to the user property and modifier parameter lists for the nodes.

See graphic.

Light Resource Palette

Each light in the scene is listed in this palette. Because the Node Hierarchy Palette contains all scene information about the light, the Light Resource Palette simply holds the pointer to the Light Resource object for the light, which stores the type, color, and effects produced by the light. Spot lights contain extra data to determine the umbra and penumbra angle.

See graphic.

Shader Resource Palette

Each shader in the scene is listed in this palette and points to a Shader Resource object, which in turn points to entries in both the Material and Texture palettes. There will be entries for a Material ID and several Texture IDs (base, bump, and others).

See graphic.

Material Resource Palette

This palette lists all the different named sets of basic material properties. Those properties are stored in a Material Resource object, which specifies properties like a material's diffuse, ambient, and specular color, opacity, elasticity, and shininess.

See graphic.

Texture Resource Palette

This palette lists texture objects, high-level structures that represent the values associated with a texture. This may include the ID of the texture, as well as its blending modes and depth. A texture object is the parent of a texture source, or may be combined with other texture objects using a texture operator.

There are two types of texture resources: a compressed JPEG image file, which is decompressed and initialized on demand from the scenegraph, and raw image data, which is processed and initialized. Parameters passed to the Texture Source determine how a Texture is compressed and stored when it is written to a Shockwave 3D file.

The texture operator combines multiple texture sources or texture objects into a single texture object. Operators include blend, blur, mask, and saturate. These operations can be animated to produce different effects.

See graphic.

Motion Resource Palette

This palette lists all motions that may be used in a scene, pointing to a Motion Resource object describing the motion. A motion consists of one or more named motion tracks, each of which contains one or more motion keyframes.

See graphic.

Mixer Resource Palette

This palette lists all the mixers that may be used in a scene, pointing to a IFXMixerConstruct object. Mixer Constructs are responsible for mapping named motions stored in a Motion Resource object to named bones in a Model Resource object. When a motion is pushed onto the play list for an object, an instance of the Mixer Construct called the IFXSkeletonMixer is created, which is used to manipulate the playback for the motion on the object.

Model Resource Palette

This palette lists each object containing geometry in the Shockwave 3D scenegraph, pointing to that object's Model Resource.

The Model Resource object is a special case of an IFXModifier class, and contains numerous pointers to other palettes and objects. It points to a chain of modifiers (for example, UV Mapping, Skeleton, Keyframe, and Primitive Generators) controlled by the modifier parameter list attached to a given scene node in the Node Hierarchy Palette, which specifies deformations or motion of the object over time. It also points to an IFXModelData object, which contains:

See graphic.

§See asterisked (*) statement at Legal Information © 2001 Intel Corporation.