[osg-users] Shadow techniques status

Jean-Sébastien Guay jean-sebastien.guay at cm-labs.com
Tue Jul 29 05:52:24 PDT 2008

Hello Dan,

> I'm looking at shadow techniques provided by the osgshadow nodekit for use
> in a production project.  On the wiki it reads like only ShadowMap is production
> ready and all the others have problems.  Is this the case?  Or have the others
> been marked as experimental because they do not work across video cards?  

Here is my opinion on the current shadow techniques in osgShadow. Please 
take these with a grain of salt. And bare in mind that it's pretty easy 
to compare them yourself in your environment, because in most cases once 
you have one shadow technique running you can just swap out the 
ShadowTechnique that you give to your ShadowedScene for another one. 
Some tweaks are technique-specific but that will give you a good idea of 
what they look like in your context.

osgShadow::ShadowVolume is broken, I have never seen it work correctly 
even with simple test scenes. There are inverted shadows everywhere 
(which hints at a problem with the z-pass or z-fail implementation). If 
someone wants to fix it, it would be a nice alternative to other 
techniques in some situations.

osgShadow::ShadowTexture is the simplest technique. It works well for 
planar shadows, but for anything more complex you'll want at least 

osgShadow::ShadowMap is what I would call the main workforce of 
osgShadow at the moment. It works well, is well tested, and is flexible. 
The only downside is the heavy shadow map aliasing you get on medium to 
large environments, but this is to be expected from a simple technique 
like this. It's really just the basic shadow map, no bells or whistles.

osgShadow::SoftShadowMap is ShadowMap augmented with a simple filtering 
of shadows. The look is not too realistic (it smooths everywhere 
uniformly instead of considering distance of occluder for the width of 
the penumbra, which would be more complex of course) but it alleviates 
the aliasing problem somewhat. It can still only go so far if the 
environments are large.

osgShadow::ParallelSplitShadowMap is the first of the "next-gen" shadow 
mapping techniques integrated into OSG. Essentially, it uses several 
shadow maps and is view-dependent which reduces aliasing dramatically. 
It's less tested, and until recently was completely broken. It now 
should work on most machines, but I'm still not confident enough about 
it to use it in production (my personal opinion - try it out and see for 

A few more techniques will soon be added (shortly after 2.6, hopefully) 
which are also view dependent, and will give some more choices to users. 
Essentially a shadow technique is a tool, and you just have to find the 
right one for your needs.

If the wiki misrepresents this state of affairs, could you please update 
it or post the pages where there is outdated info here?

Hope this helps,

Jean-Sebastien Guay    jean-sebastien.guay at cm-labs.com

More information about the osg-users mailing list