Hi weihuan,

i use osgshadow in osgart, the shadow map work fine. the model is standing on a 
plane, shadow cast to the plane, the plane is attach to the pattern, what i 
want is to make the plane invisible but the shadow remains, to make it looks 
like shadow on the top of pattern. i try alpha blending the plane, the result 
is not good, shadow become transparency too.

You'll have to create your own shader based on the one that shadow map uses (you didn't specify which shadow map class you use, but the shader code is in the source files, see for example osg/src/osgShadow/ShadowMap.cpp, or osg/src/osgShadow/SoftShadowMap.cpp, or osg/src/osgShadow/StandardShadowMap.cpp for LISPSM).

Just copy the default shader code, and then change it to do what you want. For example, you could set a Uniform bool to false on your scene root, then to true on your plane, and in your shader you would test this value and if true, simply discard fragments if the shadow test fails and render the shadow color if the shadow test succeeds.

There could be other ways to do what you want, this is just off the top of my head.

Hope this helps,

J-S

--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to