[osg-users] Using osg::shadow with Gl 3.2 (Shader 1.5)

Werner Modenbach Werner.Modenbach at texion.eu
Thu Aug 6 09:01:53 PDT 2015


Due to several reasons I had to convert a project to above versions.
I was successful almost all over the project due to the excellent work 
of osg exported uniforms etc.
The last item I have to solve now is shadow.
I'm using osgShadow::LightSpacePerspectiveShadowMapCB and I found out 
how to replace
  the given shaders.
In my old vertex shader I had to calculate the shadow texture coordinate 
like that:

if(useShadow){

gl_TexCoord[1].s=dot(eye,gl_EyePlaneS[1]);

gl_TexCoord[1].t=dot(eye,gl_EyePlaneT[1]);

gl_TexCoord[1].p=dot(eye,gl_EyePlaneR[1]);

gl_TexCoord[1].q=dot(eye,gl_EyePlaneQ[1]);

}

Unfortunately the gl_EyePanes are no more available.
I also couldn't find any uniform exports like osg_vertex etc.
Is there any way I can calculate this inside the vertex shader
by using the given uniforms and the eye position?
Or is there anything I can precalculate on CPU and provide it via uniform?

Any help is highly appreciated.

- Werner -


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150806/5f44711e/attachment-0002.htm>


More information about the osg-users mailing list