Hi Brian,

It sounds like you are going in the right direction w.r.t checking
osg::State for the current value of a uniform.  I haven't ever used
State for checking current uniform values though, its really not a
common thing that one would want to do.  If you can't get access to
the values you need then feel free to add a public method to
osg::State for access it and submit the change.

A big but though... using a uniform value to determine if you are
rendering in the main viewer camera or within a RTT camera doesn't
seem appropriate.  This type of querry is probably based handled via
the RenderInfo data structure introduced in 2.0, not
drawImplementation() now takes a RenderInfo object which has the
current osg::State object.  RenderInfo also has the current View.  In
your case both Cameras are rendering the same view so will be sharing
the same View.  Adding in the current active Camera to RenderInfo
seems resonable, perhaps a stack of cameras would be most suitable.
src/osgUtil/RenderStage.cpp would need to push/pop Cameras off this
stack as it does the draw traversal.  Again feel free to code such as
solution and submit it to me.

Robert.



On 7/11/07, Brian <[EMAIL PROTECTED]> wrote:
Hi,

I have a scene in which I have a main camera and a camera node that renders to 
texture.  Both cameras render the same basic scene with the main difference 
being the RTT scene is rendered gray scale.  The gray scale is accomplished via 
a shader.  The scene renders fine, but I have recently added a custom drawable 
to the mix and would like to determine the state of the uniform that toggles 
the gray scale.  In my camera node, I have this uniform overridden to 1, 
otherwise it is set to 0.

How can I determine the active state of this uniform in my drawImplementation?  
I've tried getting the active stateset and querying for the uniform.  The query 
returns NULL.  However, if I set a breakpoint inside my drawImplementation and 
set a watch deep within the state's _uniformMap, I can verify that the value of 
this uniform is toggling from 0 to 1 like it should.  How do I get to this 
information since a majority of it is protected?  I need it to determine which 
camera is rendering the scene.

Thanks,
Brian
_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to