[osg-users] Shadow techniques status

Jim Brooks jimblist at gmail.com
Wed Jul 30 15:29:50 PDT 2008


> > ShadowMap does suffer from bad aliasing when the viewpoint is very
> > near the shadow.
> > The Orange book (GLSL shader) describes how to super-sample
> > the depth buffer to mitigate aliasing.
>
>Indeed, aliasing is a big problem with "vanilla" shadow mapping in
>almost all real-world cases.
>
>What you describe can easily be done by client code, using the
>osgShadow::ShadowMap::clearShaderList() and
>osgShadow::ShadowMap::addShader() methods with the appropriate shaders.
>One thing that you need to be careful about when replacing the default
>shaders is to use the same uniform names to access the shadow map
>sampler and other variables.

Doh!  I wrote shadow map code from scratch but was based on osg::ShadowMap.
My shader used 9x9 sampling (IIRC) which produced little aliasing with
a slight loss of speed.
Of course, 1x1 sampling can be used if the VP isn't near the shadowed object.



More information about the osg-users mailing list