HI Mathias,

On 2/18/07, Mathias Fröhlich <[EMAIL PROTECTED]> wrote:
The clip plane number is by intention allways set to 0.

The testcase is just a coocked down version of what is required in principle.
The real application (flightgear) has an unkown number of subtrees where each
of it has 4 clip planes that are different for each subtree. That is just
like the attached example but with 4 planes attache to each ClipNode and with
an unknown number of direct child ClipPlanes just below that topleve Group in
the example.

In theory is must be possible to have a full set of those 6 guaranteed OpenGL
clip planes that are just active for a specific subtree - just like the other
StateAttributes too ?

This isn't possible without a bit of work, the reason is the ClipPlane
is a positional state attribute that relies upon the current modelview
matrix for the value it takes down on the GPU.  This positional
aspects makes it essential that you bind such state attributes with a
specific view matrix, it can't be just applied at any time like non
positional state.  Other positional state includes osg::TexGen and
osg::Light.

Its worth noting that position state all have special nodes that help
position them  - osg::ClipPlaneNode, osg::TexGenNode and
osg::LightSource, those nodes are picked up by the cull traversal as a
means of collecting the modelview matrix to bind with the position
state.  Since positional state often needs to apply to more than just
a subgraph you need to apply them at a high level, and in the OSG case
this means the RenderStage which which is part of the rendering
backend that the cull traversal fits in.  This binding means that you
effectively have one position of cliplane, light and texgen per
RenderStage.  So to have multiple clip planes working on the same
subgraph then you need to partition your scene into multiple
RenderStage's, or for each group of positional state attributes.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to