DSM Update – Testers & Builders Wanted!

July 23, 2008 at 10:30 am (Uncategorized)

(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:

  1. You can’t use soft shadows.
  2. The ‘soft’ button turns into the ‘filter’ button and represents the anti-aliasing filter width.
  3. The samples button controls the oversampling of the map, not the soft sampling (as in classical maps).
  4. You can’t increase the samples button past 5, which makes sense as this allows for a maximum of 25 oversamples.
  5. You may have to lower the bias from the default to get a good result.
  6. 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.
Advertisement

5 Comments

  1. D said,

    nice work, thanks for the OSX build

  2. hessiess said,

    have you got a tar of the code so i can make a Linux buld. or is it in the SVN repo somewere

  3. joeedh said,

  4. hessiess said,

  5. joeedh said,

    @hessiess: thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.