Version 1 (modified by martin, 10 years ago)



StateSet defines the KnowledgeBase?/OpenGL state. A stateset is a vector of states.

So what is a state? One of the parameters controlling rendering of a scene:

  • texture
  • solid, back face/front face cull, no cull, draw as lines
  • illuminated.

Continue as necessary! When a node is rendered, its state(set) is used to modify the OpenGL machine state (that is how the renderer interprets a polygon depends on the states of the OGL machine).

When a scene is rendered a large number of nodes may be rendered, and each node will set the state of the renderer as required. Generally the existing state will be overwritten by the new state(s).

The OSG however is clever enough to sort Nodes by state (so called StateSorting?), so that the minimum number of changes occurs (less work means faster).