Hello Werner,
I suggest altering one line of the shader code of StandardShadowMap into:
(_mainFragmentShader)
color*=mix(colorAmbientEmissive,gl_Color+gl_SecondaryColor,
DynamicShadow());\n"
Otherwise no specular light is shown.
Yes, Wojtek mentioned about a week ago that this was an oversight on his
part, so please submit the whole modified file to osg-submissions.
Also it would be nice having a chance to using the existing shader code
in a derived class and just add new functions i.e. for bump mapping
without cut and paste the shader source code.
I suggest putting all the functions in separate shaders and leaving just
a minimal main() function.
All shaders could go into a vector of shaders being loaded in the init
function. This way it would be easy creating additional shaders (shader
functions) and just slightly modify the main() function.
Is there any maintainer of the code? Otherwise I would try to do the
alterations myself.
I would advise against doing this, for the simple fact that it would be
an interface specific to that class, whereas other classes that need
shaders might do things differently. I think it's easier to just set the
shadow technique's shaders to NULL, and set whatever shaders you want on
the scene. Note that you can also set shaders anywhere in the graph, so
you could have nodes without normal mapping, others without shadows,
etc. so setting all types of shaders on the shadow technique itself
doesn't really make sense.
Eventually shader composition will be available in OSG, and we'll be
able to hopefully have a coherent interface for adding and overriding
shader parts in the scene graph. Until then I don't think it's useful to
change this.
Hope this helps,
J-S
--
______________________________________________________
Jean-Sebastien Guay [email protected]
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org