[osg-users] ShadowMap problem...
jean-sebastien.guay at cm-labs.com
Wed Nov 11 11:06:31 PST 2009
> I have changed to a LISPSM shadow technique.
> I have removed the cast bit from my terrain.
> The only two objects I have set cast shadow are close together.
This should not need to be done when using LISPSM. It's view-dependent,
so you don't need to make sure that the shadow map is applied to a small
part of the scene as you did with the normal ShadowMap. Still, it
doesn't hurt if you don't need shadows cast by your terrain anyways.
> My texture size is 2048 x 2048.
> Not seeing shadows on the terrain from my objects.
Did you check the debugHUD (with LISPSM it's as easy as
shadowTechnique->setDebugDraw(true) )? Does it show something that looks
Note that LISPSM's shaders are different than ShadowMap's shaders that
your used before. It uses a different name for the shadow map sampler,
and by default it separates the shaders into main and shadow parts,
though you can still disable the shaders that LISPSM adds and use your
own (make sure to use the right sampler and uniform names in your
shader). Check the source in StandardShadowMap.cpp to see what the
shaders look like.
> Changed shadowTexture unit to 7.
> Should basetexture be 0 still?
The base texture unit is just used by the shaders that LISPSM sets by
default. If you're disabling those and using your own (which you surely
do if you're using units 0-3 for some effects), then don't worry about it.
Hope this helps,
Jean-Sebastien Guay jean-sebastien.guay at cm-labs.com
More information about the osg-users