Soft Shadow Volumes

Started by
4 comments, last by LarsMiddendorf 18 years, 11 months ago
Recently I read an article on 2D lighting with soft shadows (gamedev article iirc), and the technique described there was basically a shadow volume technique with added penumbra regions (calculated for a circular light). My first thought was that this could be extended into 3 dimensions, to create realistic realtime soft shadows. After a bit of searching I found a few articles that dicuss this possiblity (here: http://graphics.cs.lth.se/research/shadows/ ) So I wanted to ask: has anyone here tried implementing these? And what were your results?
Advertisement
I havn't implemented soft volumetric shadows myself but I know that you can get volumetric soft-shadows using post-processing effects. I also know that Eric Lengyel implements it in his C4 engine check it out at http://www.terathon.com/index.html
I just looked at that link, and he does not use Post-Processing effects to achieve soft shadows, he uses penumbra wedges which is exactly what i meant. Besides, post processed soft shadows are usually just blurred hard shadows and thus fairly uninteresting (as they are obviously incorrect-looking)
Shadow rendering with penumbra wedges seems to me to be the logical 3d extension of the 2d method (although I think it was actually around first, I hadn't actually spotted it before though). But its vastly more complicated, requiring pixel shader voodoo to render proper 3d volumes. Very nice results from what I've seen though.

The post-process versions (usually doing a blur between two hard shadows) tends to be not physically accurate and have weird shimmery artifacts as the view moves because of the low-res blurring. Shadows tend to bleed too.
Here are some notes on my experiences with penumbral shadows. BTW, you can download the slides from my GDC lecture on the topic from http://www.terathon.com/.

* The most correct algorithm is very complex, but does produce very nice looking results. Unfortunately, it is also very slow, so unless your scene is made up of a bunch of simple boxes, you're not going to have a great frame rate even on today's best graphics cards. If you throw a character in there with even a modest polygon count, forget it.

* You can gain a lot of performance by tossing physical correctness out the window and only softening the outer half-wedges around the ordinary stencil shadows. By dropping the inner half-wedges, you'll no longer get true symmetric penumbrae or umbrae having finite range, but the shadow edges are still very soft and look good.

* Even more performance can be gained by throwing out the light coverage calculation altogether and just doing a dumb linear falloff between the extruded stencil volume and the outer planes of the penumbral wedges. I haven't implemented this one yet, but I'm hoping to soon, and I bet it will be fast enough to use in moderately complex scenes. The fact that it's not anywhere near physically correct probably doesn't matter a whole lot in a fast-paced video game.

-- Eric Lengyel
@Eric Lengyel

How many times slower are penubra wedges on a gf6 than default stencil shadows?

This topic is closed to new replies.

Advertisement