Hi Joel,

So far as your optimization tip goes, I assume you're meaning to apply the 
shader at the transform node as well?  I've been doing that sort of thing 
already, just not on my Transform nodes...

No, I mean that all non-Transform children under a Transform will have the same transformation, so you can put the uniform ONLY on Transform nodes. The non-Transform nodes (Geodes etc.) under them will then inherit the uniform.

In my case, I was putting the uniform on Geodes, but say there are 20 Geodes under one same Transform then my code would (I assume) send the uniform to OpenGL 19 times too many (redundant state changes = bad).

You just have to handle the one exception where there may not be a Transform between the root of your graph and a non-Transform node, but that will in general be very rare.

Anyways, it may well be premature optimization. Putting the uniform on Geodes is much easier (that's why I did that for my simple example) so you can start with that and see if performance is acceptable. As Robert says, if you get 60hz in all your use cases, you're done, go have a beer. ;-)

Anyway, thanks for the sample code - I really appreciate that.

Hope it helps you out.

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