Hi Robert,
I've just refactored my previous ShaderComposition driven attempt to use
the new pragmatic scheme. (It turned out to be relatively easy)
At first glance the basics work fine, but I have some questions:
1. When will the debug output in console be removed? ;-)
2. I have some StateSet on top of a group representing my scene. Later
during rendering a new element is added, but with some additional define.
My naive expectation would be, that the new element will be using the
top-level program, recompiled with the new define.
Is this supposed to be working? What I want is to anonymously add some
define for my subgraph, not caring which top-state it has been placed
below.
Or do I somehow need to dirty something here to get a new Program (based
on the code of the program on top + my new define) built for this sub-graph?
Cheers
Sebastian
Hi All,
I have now checked in core OSG support for a new form of shader
composition that leverages #pragma's to extended GLSL shaders to
specify which #define's that it requires from the scene graph. The
scene graph passes these to the shaders via StateSet::setDefine(..)
and provides full support for the OSG's state override/protected options.
I have modified the osgshadercomposition example to illustrate a very
simple example that utlizes three shaders checked into
OpenSceneGraph-Data/shaders trunk. So on the code look for
OpenSceneGraph/examples/osgshadercomposition.cpp and on the shader
from look at OpenSceneGraph-Data/shaders/osgshadercompostion.vert,
osgshadercomposition.frag and lighting.vert.
I will write more later about how to use this new capability. It's
gotta be one of the coolest features added to the OSG for quite a few
years :-)
Cheers,
Robert.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org