Hi Matthew,

Now, you can't change a uniform during a single OpenGL "traversal", of course (i.e., 
between glBegin() and glEnd()), but there is nothing stopping you from changing a uniform at any 
other time. If a single "object" is broken into several glBegin()/glEnd() sections for a 
given rendering pass, it is perfectly acceptable to change the value of a uniform in between each 
individual section.

Sure, but at a higher level, if your object is broken up in such a way, then you might as well think if it as two distinct drawables, in which case they can both have the uniform with different values.

I guess I'm just used to building a graph at startup as much as possible, and only modifying things at run time if necessary. If part of an object will need a certain uniform value and another part needs another value, I'd probably just break it up into two drawables, each with the right value, from the start.

Anyways, I don't think the OP was thinking of something quite so detailed... I think they actually had distinct objects and thought they could only have a given named uniform once in the scene graph, and thus they wanted to modify it when the rendering got to a given object. I pointed out that in each stateset (if you want), and in particular in that object's stateset, you can have a uniform with the same name but a different value, which is not obvious but follows how other state attributes work too.

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