Hi,
as I mentioned somewhere else, we are also thinking about a shader composition 
concept. 
After some consideration we came to the conclusion, that shader linking is 
probably the most time-effective approach. 
So we would go with Wojtek and use his VirtualProgram - extending and 
implementing it.
In combination with a clean shader implementation of the FFP you can 
activate/deactivate FFP-functionality by linking an empty dummy-function or a 
fully implemented function.
These FFP-functionalities could also be used in own shadercode - just use the 
(ie osg_fog-)function in your own code.
OSG will link it, when fog is activated and unlink (read: link empty function), 
when fog is deactivated.
The linking itself should be much faster than generating some shadercode on 
runtime (even with caching).
Using empty functions as "not-active"-dummys may sound like overhead, but 
calling a (empty) function didn't cost any measurable time when we tested it.
Linking/Unlinking and updating needed uniforms could be implemented in 
osg::State ie through the mentioned shadercompositor-interface.
... 

Cheers,
Johannes

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=29409#29409





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

Reply via email to