Re: [osg-users] Custom Vertex Shader with Parallel Split Shadow Maps

2015-08-31 Thread Julien Valentin
Hi,

After a long time here's our answer:


Code:

vec4 pos=ftransform();
vec3  ecPosition3 = pos.xyz / pos.w;   
vec4  ecPosition=vec4(ecPosition3,1); 
gl_TexCoord[1].s = dot( ecPosition, gl_EyePlaneS[1] ); 
gl_TexCoord[1].t = dot( ecPosition, gl_EyePlaneT[1] ); 
gl_TexCoord[1].p = dot( ecPosition, gl_EyePlaneR[1] );
gl_TexCoord[1].q = dot( ecPosition, gl_EyePlaneQ[1] );  



cf osgShadow/StandardShadowMap.cpp

Cheers,
Julien

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64965#64965





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Custom Vertex Shader with Parallel Split Shadow Maps

2012-02-01 Thread Nick Jones
Hi,

  I am trying to integrate the Parallel Split Shadow Map (PSSM) algorithm into 
my current project. I've noticed that the algorithm utilizes the fixed pipeline 
as it only incorporates a fragment shader. 

  However, my project requires me to write a custom Vertex shader as well. When 
I do that, it seems that the values in the gl_TexCoord of the fragment shader 
may be incorrect. If this is the case, it seems as if I am sampling the shadow 
map incorrectly as well.

  I came to this conclusion because while I do see shadows, they are 
incorrectly placed and change drastically when my camera pans around the scene.

  Does anyone know how to recreate the proper gl_TexCoord values in a custom 
vertex shader? If I could recreate them properly, then the fragment shader 
should work as well.

Thank you for your help!

Cheers,
Nick

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=45154#45154





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org