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.
The following functions add an nvsg::StateAttribute to an nvsg::StateSet:
- addAttributeBack() adds an attribute at the end of the list
- addAttributeFront() adds an attribute at the beginning of the list
- appendAttributes() adds a number of attributes at the end of the list
- insertAttributes() adds a number of attributes at the beginning of the list
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.
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:
- If there is an equivalent attribute in the global state set, that attribute is used as the default.
- If there is no equivalent attribute in the global state set, the default values for the attribute are used.
Back to Working With NVSG Classes
Generated on Tue Mar 1 13:20:36 2005 for NVSGSDK by