Thank you Robert, this is some very useful information.

The most recent related thread I could find on this topic is from Aug/Sept
2007:
"RFC: Positional state container in the render bin, was: clip planes"

There is discussion in that thread about using renderbins.  What are the
advantages of using renderbins versus renderstages?  The code attached in
that thread modifies RenderBin, RenderStage, CullVisitor, and osgClip.
However, it appears from doing a diff that those changes have not been
integrated into OSG 2.8.2.  Is this the FlightGear emulate solution you
mention below, and it is just not integrated into OSG 2.8.2, or are you
talking about a different solution implemented in a different way?
Unfortunately simgear.org which contains much of the osg code for flightgear
(at least from my understanding) has not been available for at least the
last few days.  

Thanks!

Jason


 




-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Robert
Osfield
Sent: Thursday, May 13, 2010 1:21 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] reuse of clipping planes?

Hi Jason,

Clip planes are an example of positional state, other examples are
lights and eye linear texgen.  All positional state requires a
specific modelview matrix to be bound to them to position them
correctly in space, so unlike other OpenGL/OSG state you can't just
push/pop and state sort their state and expect to get the correct
results.

This difference is handled by the OSG by binding the positional state
together with a modelview matrix found when encountering the
ClipNode/TexGenNode/LightSource nodes, and these positional state are
then applied once at the start of each RenderStage.  Applying the
state just once for whole RenderStage does enable us to position the
state uniquely but unfortauntely also means that the positional state
can only be in one place for the whole stage - you can't nest it.

You can emulate having multiple sets of Clip planes/texgen/lights by
having multiple stages, or do what is currently done in FlightGear, to
use a custom StateAttribute that does the binding to the required
modelview matrix in the CustomAttribute::apply() method taking care to
push back the current modelview matrix to prevent the rest of the
scene being affected.

Robert.

On Thu, May 13, 2010 at 2:14 AM, Jason Jerald <[email protected]>
wrote:
>
>
> Evidently most graphics hardware only supports 6-8 clipping planes and our
> application requires more than that so I  need to somehow reuse clipping
> planes.  I searched the archives and saw there was some discussion of this
> back in 2007 (something about possibly using the render bin instead of the
> render stage but it is not clear how to do so).  Has reuse of clipping
> planes since been implemented?  If so how do I do so (I have not been able
> to figure out how to do so by looking through clipnode)?  Or if not, does
> anyone have any ideas/example of how to implement reuse of clipping
planes?
>
>
>
> Thanks so much!
>
>
>
> Jason
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to