I have multiple shaders. I attach one shader to the root of the scene graph. I 
then load in objects and attach one of another set of shaders to the root of 
the object and attach it to the main scene graph. When I say "attach a shader", 
I'm loading a fragment and vertex shader from a file and attaching them to a 
new Program object each time. I then attach the Program object to the object's 
state set.

Is there any performance advantage to doing it this way or creating one Program 
object for each shader and attach these same Program object to my objects. Or 
should I be creating a set of StateSet's and attaching the appropriate StateSet 
to my object based on the Shader I want to use.

To complicate things, I have multiple cameras used to render to multiple Frame 
Buffer Objects.

What I'm seeing is a (single) missed frame when an object with a "new" shader 
appears in the Field of View (running at 120Hz)?

Could OSG be attempting to "recompile" my shader? Is driver downloading the 
shader each time to the video card.

Paul P.


      
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to