Hi Farshid,

> I ran into a case where I needed access to the CullVisitor, RenderStage, and 
> FBO objects from within the draw method of a drawable. I usually prefer 
> solutions that don't require changes to the core OSG, so my solution is 
> admittedly hacky, but it works fine for my use case. 


So do I, but sometimes I try to clean my hacks by submitting somes changes 
which could be usefull for all developpers.


> I created a custom StateAttribute class that stores a pointer to the 
> CullVisitor/RenderStage objects. I attach a cull callback to my Camera that 
> performs a push/pop of the state attribute to the cull visitor stateset 
> stack. 


Very intersting idea, I'll try that, it could help me a lot to have access to 
the RenderStage. Thanks for sharing !


> In the future, it would be nice to get a pointer to the current RenderStage 
> object from the osg::State.


Yes, it would definitely be usefull ! Maybe not necessary from the osg::State : 
I'm not sure this is the right place to store the current RenderStage : a 
RenderStage is maybe more part of the "current rendering" than the "current 
OpenGL State". Perhaps storing it in the RenderInfo passed to the "draw" method 
should be enough ?

(but the problem of circular dependcy still exists...)

Cheers,
Aurelien

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=55386#55386





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

Reply via email to