>
Very excited about the new features Robert, sounds like you're really cracking
on.
I had two thoughts I hope you'll consider integrating:
One is that GLSL is quite poor for initialization. The main problem with this
is if you were to enable a shader with, say, 8 uniforms, there wasn't, until
very recently, a way to initialize them, and the stateset enable calls
generally are single parameter. So in with the definitions of a new possible
shader mode, and the attributes/uniforms it needs, we will probably need a way
to initialize any uniforms that the shader needs, but the user may not
specifically set. Default values, in essence, but also just non-random values.
Second is that, although your point about trying linking on the fly and then
seeing what happens is a good one, I'm worried about the fact that different
GPUs, drivers, OS's etc have very different costs for this, (all of which would
be too much in some circumstances).
I was thinking that we could maybe build in the ability to use a conditional in
each shader as a matter of course. That way the program object can be left as
is, and sorted correctly, and the conditional uniform set instead of
re-linking. The comparable mechanism to me is the 'dynamic' setting of nodes,
or the 'useDisplayLists' setting.
So for example, instead of just:
vec4 applyBlur (vec4 inPixel
{
return inPixel;
}
or
vec4 applyBlur (vec4 inPixel)
{
vec4 outPixel;
// do costly blur
return outPixel;
}
the non-placeholder version might have:
vec4 applyBlur (vec4 inPixel)
{
if (!blurEnabled)
return inPixel;
vec4 outPixel;
// do costly blur
return outPixel;
}
I hope you see the advantages - far more shader sharing and less compilation in
a complex situation.
Bruce
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org