Hi Brent,

What happens if I attach a program shader to a group node and then a different 
program shader to the child node?  Are both shaders executed?  Just one?  What 
order?  Precedence, etc?

The same rule as for any other state applies here: a state attribute on a child is inherited from the parent, unless the child specifies its own attribute.

However, shaders are not executed while traversing the graph, they are only executed when something is drawn. Only one state attribute can be active on a given state set at a time, so no, shaders cannot be combined like that. So the question is which program is active on a given drawable, and that is determined by the path down to the drawable and which program was last encountered on that path.

Say you have

                   root  <-- programA
                   /  \
                  /    \
no program -->  Node1 Node2  <-- programB

Well, if Node1 has any drawables under it, programA will be active when those drawables are drawn, and if Node2 has any drawables under it, programB will be active for them.

Hope that helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                    http://whitestar02.dyndns-web.com/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to