On Jun 25, 2010, at 6:42 AM, Mathias Fröhlich wrote:

> With that proposal - espcially the StateAttribute::compose call working 
> directly on the osg::State - I conclude that we need to relink during draw:
> * we will probably loose state sorting for the shader combinations
> * shaders need to be at least relinked on every state change which will have 
> some runtime (drawtime) overhead.

Actually, I was thinking of something more sophisticated:

Use shader linking and/or conditional compilation/string concatenation for 
shaders that are defined ahead of time.
Use conditional if/then statements for attributes that are declared as dynamic.

That way you can sort on the shader, just set the uniforms (including the ones 
used for conditional switches) per use, and you also minimize re-compilation 
and/or re-linking.

This should probably be selectable back-end behavior, in the same way that 
display lists are now.

Bruce



_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to