DSM Update – Testers & Builders Wanted!
(Note: Windows build updated on July 24th)
(New: Linux autobuild added)
(New: Linux 64-bit build added)
Introduction
Deep shadow mapping is a volumetric shadow method, supporting things like transparency and anti-aliasing. DSM tends to produce higher-quality shadows then classical shadow buffers, but are also significantly slower. They do however support transparent shadows, and are faster then ray shadows for this purpose. They are great for hair and fur rendering, but are also somewhat slow for this purpose.
DSM’s are especially useful for volumetrics, as they easily allow volumetric self-shadowing and shading effects (though the volumetric project is so new that I’ve yet to interface my DSM implementation with it). They can also be used for a physically-correct, soft shadow algorithm (based on area lights), though the code for this in my implementation does not work as yet.
Here’s a pretty picture:
Note that the glass plane is rendered using the filtered transparency feature (the “Filter” option in the ray panel) which works with DSM (but not ztransp, so I had to render the glass with ray transparency).
Builds
You can find builds of DSM here (I’ll try to add more links to more platforms as people build on them):
Windows 32 bit : here
OSX 10.5 Intel: here
Linux 32 bit autobuild (courtesy of Panzer): here
Linux 64 bit (courtesy of hessiess): here
These builds are hosted on graphicall.org.
How to Use It
To use DSM, you set up a lamp as if you were using a normal shadow buffered lamp, with a few differences:
- You can’t use soft shadows.
- The ‘soft’ button turns into the ‘filter’ button and represents the anti-aliasing filter width.
- The samples button controls the oversampling of the map, not the soft sampling (as in classical maps).
- You can’t increase the samples button past 5, which makes sense as this allows for a maximum of 25 oversamples.
- You may have to lower the bias from the default to get a good result.
- Don’t use auto-clip-start or auto-clip-end, these tend to mess stuff up for some reason.
Version Info
After a year of frustration, DSM is nearly a usable state. Material evaluation (e.g. textures in shadows) works, which was no small feat to pull off. Additionally, many bugfixes and issues have been worked out.
Unfortunately, soft shadows do not work yet (in fact, in the UI the “soft” parameter is renamed to “filter” and limited to 3.0). DSM’s (unworking) soft shadow code actually use the ray soft shadow parameters; as such, the “samples” and “filter” (formerly soft) parameters in the shadow buffer panel are used to control anti-aliasing settings, not soft shadow effects.
By their nature, DSM maps are always anti-aliased (unlike classical shadow buffers in blender). The amount of oversampling is based one the samples parameter squared (and not the oversampling buttons used for classical shadow maps). The filter parameter in the panel is used to set the anti-aliasing filter width, with a max value of 3.0.
Known Issues
- Only bilinear interpolation is used, which isn’t the best.
- DSM’s speed advantage over ray tracing is most apparent in somewhat complex scenes. Very simple scenes will not be faster.
- The soft shadow code doesn’t work yet, and is currently disabled.
- As in many shadow mapping algorithms, bias is annoying. The only way to fix this would be to adapt the half-way (midpoint) algorithm to DSM, which would involved “squashing” objects within the map along the view vector (which would mean first identifying which samples *are* the objects, or perhaps squashing the objects before rendering the map). Unfortunately, this would only work for solid objects, and would probably give totally incorrect results for the soft shadow algorithm.
- It’s slower than classical shadow maps, which is perfectly normal (as it has a lot more to *do* than classical shadow maps). Most of the extra time is in creating the map in the first place.
- There’s some parts of the code, most notably the disk cache system, that I need to document further.


D said,
July 23, 2008 at 8:16 pm
nice work, thanks for the OSX build
hessiess said,
July 24, 2008 at 9:18 pm
have you got a tar of the code so i can make a Linux buld. or is it in the SVN repo somewere
joeedh said,
July 25, 2008 at 7:25 pm
It’s in svn, yes, at https://svn.blender.org/svnroot/bf-blender/branches/soc-2007-joeedh/
thanks,
joe
hessiess said,
July 26, 2008 at 7:58 pm
thanks,
64 bit Linux
http://uploader.polorix.net//files/908/3D%20stuff/blender_dsm.tar.bz2
joeedh said,
July 26, 2008 at 8:40 pm
@hessiess: thanks