Hi, J-S, Mike, Leif,

    Thanks for the replies. J-S, using the node visitor indeed seems 
like the best solution. I'll try that out for sure.

    Cheers,

    Yefei 

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:osg-users-
> [EMAIL PROTECTED] On Behalf Of Jean-Sébastien Guay
> Sent: Tuesday, April 08, 2008 7:39 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] Shader question concerning GL_LIGHTING etc.
> 
> Hi Yefei,
> 
> > Am I really reduced to modifying the core of OSG to add
> > uniforms and set their values whenever a relevant GL call is being
> > made?
> 
> To add to what Mike and Leif said, you don't have to modify OSG. You
> could just write a visitor that does what you want, i.e. traverse the
> graph, checking for the state you need to set uniforms for, and then
> applying them. The same visitor could accumulate state from the root
> and
> when reaching a leaf node (geode), apply the right shader for the
> accumulated state.
> 
> With a bit of work you can get a solution that's pretty general and
> works well, and which is also pretty optimal.
> 
> Hope this helps,
> 
> J-S
> --
> ______________________________________________________
> Jean-Sebastien Guay    [EMAIL PROTECTED]
>                                 http://www.cm-labs.com/
>                          http://whitestar02.webhop.org/
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-
> openscenegraph.org


_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to