Hi Paul,
Anyone interested in photorealistic rendering effects and maximum
performance will already be spending a lot of time modifying individual
shaders. I don't see this as a significant problem for that group of
developers.
I disagree. Have you seen the number of combinations of shaders needed
in recent games? The point of shader composition is not to replace the
fixed pipeline (though I could see that as being the default for OSG, to
make development easy for newcomers), but that you don't have to develop
and test every single combination of effects one by one.
Say you have objects that need the following possible rendering states:
one, two or three textures
lighting on or off
bump mapping on or off
precomputed lighting in addition to the dynamic lighting on or off
shadows on or off
Then, if you don't use shader composition, you will have to hand-code
and test 48 shaders (sure, bump mapping or shadows without lighting
don't make much sense, but that's just 2 combinations less).
Using shader composition, you can have 11 shader fragments (just one for
each state above) and combine those fragments at load time depending on
what effects you want on a particular node.
I don't know about you, but I'd rather work on 11 small shader "parts"
than on 48 big shaders. If I have a change to make or a rendering bug to
fix, chances are I'll only have to touch one or two files, whereas
without shader composition I'd have to go through all of the shaders and
modify each of them.
You still have total freedom on what happens in those shader fragments,
and what fragments you use. But it just makes maintenance easier. At
some point you have to be willing to exchange a tiny bit of performance
for a much more maintainable code...
J-S
--
______________________________________________________
Jean-Sebastien Guay [email protected]
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org