Hi Mike,

You can't just throw in a very simple vertex shader to replace the
built in vertex shader and expect it to work.  The vertex shader has
to use texgen to create the texture coordinates for the shadow map.

Robert.

On 14 November 2011 12:06, Mike Connell <michael.conn...@gmail.com> wrote:
> Hi
>
> I've recently been testing out the new VDSM shadow implementation in trunk,
> it's looking really nice.
>
> I have a problem with the default fragment shader - it stops working as soon
> as I attach a vertex shader, even a quite innocuous one like this:
>
> void main(void) {
>     gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex ;
>
>     gl_TexCoord[0] = gl_MultiTexCoord0;
>     gl_TexCoord[1] = gl_MultiTexCoord1;
> }
>
>
> I am working with the osgshadow demo program, modified to attach the above
> shader alongside the fragment shader, and before the VDSM is constructed I
> edit the settings so that the shaders are constructed and used like this:
>
>
> settings->setShaderHint(osgShadow::ShadowSettings::PROVIDE_VERTEX_AND_FRAGMENT_SHADER);
>
> The strange result is that both the vertex and fragment shaders appear to
> run and there are no warnings about errors compiling or linking the
> them.However the call to shadow2DProj() will always return (1,1,1,1) iff a
> vertex shader is attached, but work fine without a vertex shader present -
> ie every fragment is treated as shadowed.
>
> It feels like there is something vital missing from the vertex shader that
> shadow2DProj relies upon, and which is provided by the fixed function
> pipeline?
>
> I've also stripped the fragment shader down to simply perform a texture
> lookup on the base texture and modulate by the value returned from
> shadow2DProj, but this doesn't appear to make any difference.
>
> Has anyone seen anything like this before? Ideas?
>
> TIA
>
> Mike
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to