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
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to