Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Working with State Attributes

An nvsg::GeoNode holds a number of pairs of nvsg::Drawable and nvsg::StateSet. An nvsg::Drawable contains the geometry, while an nvsg::StateSet holds a number of nvsg::StateAttribute. This set of attributes determine the visual appearance of the corresponding geometry.

Adding Attributes to a Set

The following functions add an nvsg::StateAttribute to an nvsg::StateSet: None of these functions prevent multiple instances of equivalent attributes in the list. When traversing a list of attributes with multiple equivalent elements, the last of the equivalent attributes replaces any previous one. Therefore, for performance reasons, it is advisable to avoid multiple equivalent attributes in any one state set.

When a Set Does Not Contain a Special Attribute

Normally, the state attribute that is in this set is used with the corresponding geometry. When the set does not contain a special type of attribute, a default for the attribute type is to be used. This means that the parameters controlled by such an attribute type are explicitly reset to some defined values. This prevents any dependencies on the sequence of the drawables.

Note:
There might exist state attributes that make other state attributes obsolete. For example, when there is an nvsg::CgFx attribute, every other attribute such as nvsg::Material or nvsg::Texture are ignored.
When deriving from nvtraverser::RenderTraverser (like nvtraverser::GLTraverser does), a two level default handling is used: Back to Working With NVSG Classes
Generated on Tue Mar 1 13:20:36 2005 for NVSGSDK by NVIDIA