Hi Roger,

The only way round it is to write your own shadow technique which derives from lispsm and overrides the shaders with ones that do what you want.

This comes back to what we were discussing a few days ago, and I think you misunderstood what I was explaining. You don't actually need to derive a new shadow technique if all you want is to change the shaders... You could just write new shaders and use osgShadow::StandardShadowMap's API to set them on the existing shadow technique (be it LiSPSM or others in Wojtek's contribution):

    void setShadowVertexShader( osg::Shader * shader )
        { _shadowVertexShader = shader; }

    void setShadowFragmentShader( osg::Shader * shader )
        { _shadowFragmentShader = shader; }

    void setMainVertexShader( osg::Shader * shader )
        { _mainVertexShader = shader; }

    void setMainFragmentShader( osg::Shader * shader )
        { _mainFragmentShader = shader; }

This is what we do here. We made our own shaders which support the features we want (all light source types, multiple lights (but only one casts shadows), multitexturing, fog, etc.) and use these methods to give the new shaders to the shadow technique to use instead of the ones it has in its code.

Much simpler than deriving the class, and more data-driven too - you can have the shaders in files on disk and change them without recompiling.

Unless I misunderstand what you (or the OP in this thread) want to do...

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

Reply via email to