Brecht added Deep Shadow Buffer to 2.5!

Brecht has just commented his implementation of deep shadow maps, to replace the old SoC project that is no longer under development, to 2.5!

I’m off to build…

Here’s the comment:

Revision: 23794

Author:   blendix
Date:     2009-10-12 21:41:40 +0200 (Mon, 12 Oct 2009)

Log Message:
Deep Shadow Buffer

Since the deep shadow buffer summer of code project is not actively under
development anymore, I decided to build my own DSM implementation from
scratch, based on reusing as much existing shadow buffer code as possible.
It's not very advanced, but implements the basic algorithm. Just enough so
we can do shading tests with it, optimizations and other improvements can
be done later.

* Classical shadow buffer options: filter, soft, bias, ..
* Multiple sample buffers, merged into one.
* Halfway trick to support lower bias.
* Compression with user defined threshold.
* Non-textured alpha transparency, using Casting Alpha value.
* Strand render.

Not Supported:
* Tiling disk cache, so can use a lot of memory.
* Per part rendering for lower memory usage during creation.
* Colored shadow.
* Textured color/alpha shadow.
* Mipmaps for faster filtering.
* Volume shadows.

Usage Hints:
* Use sample buffers + smaller size rather than large size.
* For example 512 size x 9 sample buffers instead of 2048 x 1.
* Compression threshold 0.05 works, but is on the conservative side.

Here’s what Joseph Eagar had to say in his proposal:

And, here’s another link to information:

It’s not based on the old gsoc 2007 project! Brecht says he built it from scratch and tried to re-use current shadow buffer code.

Fixed. Sorry about that, was too excited to read thoroughly, I guess. I was misinterpreting ‘existing shadow buffer code’ to mean SoC code, though if I’d been more careful, I don’t think I’d have made that mistake, it’s pretty clear.

Didn’t expect that, but a very nice surprise, plus this implementation has support for soft shadow edges like in buffer shadows too.:wink:

I hope he goes farther with this, but apparently right now shading tests can be done for Durian.

quick test render to compare clasic buffshadow with new deep shadows

No good example. The DSM was created for blond hair to be rendered corrected.

you really should have worded that better. :wink:

Blond would be the optimal test case to see the difference,
but it help quite a lot here as well,
eg. imagine brown haired girl being rendered close up in 4k
(with or without a dragon ;)).

Here’s an example, probably the simplest possible one, but I think you can see the effect… Only one light, default strands but with some transparency.

Classical on left, deep on right:

This will really shine once it supports volume shadows.

The DSM implementation I am familiar with offers a “distance inside” mode that returns the length trough the volume of the object being shaded. This can then be used to drive effects like translucency and opacity, fake subsurface or gumi effects like in this Pixar paper.

I think it does by default(I could be wrong, please point it out if I am)…but this is indeed good news, as well as for baking for my game.


this is amazing :slight_smile:

now just waiting for the volume support…

Would this be his secret project? Or would that be something else completely?

Yeah. I didn’t mean to say that the example was bad as in “It sucks” but instead meant that it wasn’t optimal for that kind of fur/hair to see the difference.

I read somewhere that DSM was especially designed to work with blond hair cause it was hard to show depth otherwise. Blond hair has different shattering of light and so on.

found it;

I guess its not the secert project I asked… But sure turns out nice results fairly fast, depending on the settings