Real-Time Soft Shadows
So I've recently gotten real-time stencil-based shadows basically working in Rotrix, using shadow volumes. The big problem with this method of course is that all the shadows have hard edges.
![[Image: shadowshot.png]](http://www.doomlaser.com/rotrix/screenshots/shadowshot.png)
![[Image: shadowshot2.png]](http://www.doomlaser.com/rotrix/screenshots/shadowshot2.png)
Danlab pointed me to this paper (PDF, 28mb) on Real-Time Soft shadows. I've only looked at it briefly, but it looks like its similar to the stencil-based shadow volume approach, but also constructs wedges around the edges of the silhouette whose intersections with geometry are rendered and somehow blended to smooth out the edges? Has anyone else read it?
Anyway, I'd be interested to know how other people are attacking the problem of creating soft shadows.
![[Image: shadowshot.png]](http://www.doomlaser.com/rotrix/screenshots/shadowshot.png)
![[Image: shadowshot2.png]](http://www.doomlaser.com/rotrix/screenshots/shadowshot2.png)
Danlab pointed me to this paper (PDF, 28mb) on Real-Time Soft shadows. I've only looked at it briefly, but it looks like its similar to the stencil-based shadow volume approach, but also constructs wedges around the edges of the silhouette whose intersections with geometry are rendered and somehow blended to smooth out the edges? Has anyone else read it?
Anyway, I'd be interested to know how other people are attacking the problem of creating soft shadows.
* akb825 looks at size of PDF and compares to rate of download
* akb825 decides to take a look later
The standard method is to use shadow mapping and to use percentage-closest filtering. Of course, you're going to have to use shaders for the soft shadow portion of it. If you google shadow mapping, you'll get a lot of sites describing it. If you want to go all out, though, AFAIK the best variation of shadow mapping is trapezoidal shadow mapping. (however, some of the math may get a little complex, and since your scene doesn't look too complex or dynamic with respect to the lights, you may find regular shadow mapping to be just fine)
* akb825 decides to take a look later
The standard method is to use shadow mapping and to use percentage-closest filtering. Of course, you're going to have to use shaders for the soft shadow portion of it. If you google shadow mapping, you'll get a lot of sites describing it. If you want to go all out, though, AFAIK the best variation of shadow mapping is trapezoidal shadow mapping. (however, some of the math may get a little complex, and since your scene doesn't look too complex or dynamic with respect to the lights, you may find regular shadow mapping to be just fine)
A quick glance at that paper shows that it's prohibitively expensive (5fps for a tiny scene on a GeForce 3) and some of the implementations have prohibitive hardware requirements (pixel shaders that won't run on Radeon 9500-X600 cards).
akb825 is right, if you're looking for reasonably accurate soft shadows, shadow mapping with some of the enhancements will get you a lot closer and a lot cheaper than the methods in that paper.
Shadow mapping also has the advantages that you can easily scale back -- for example, if you detect that the hardware isn't fast enough to do PCF, you can fall back to no filtering, and still get a decent-looking result.
akb825 is right, if you're looking for reasonably accurate soft shadows, shadow mapping with some of the enhancements will get you a lot closer and a lot cheaper than the methods in that paper.
Shadow mapping also has the advantages that you can easily scale back -- for example, if you detect that the hardware isn't fast enough to do PCF, you can fall back to no filtering, and still get a decent-looking result.
If you really want nice looking soft shadows that are even decently fast you need to go with shadow mapping. You can do soft shadows with stencil shadows, but it's a pain in the ass and pretty dang slow.
However, if you're doing outside scenes with just the Sun casting shadows, I tend to prefer hard-edged stencil shadows. The sun casts shadows with fairly hard edges in real life, so you can get away with it. And for large outdoor scenes I've found it's much easier to get decent looking shadows with stencil shadows than with shadow maps.
Humus has some nice shadow demos. Check 'em out. You'll need a Windows machine to run them, but he includes the source code.
However, if you're doing outside scenes with just the Sun casting shadows, I tend to prefer hard-edged stencil shadows. The sun casts shadows with fairly hard edges in real life, so you can get away with it. And for large outdoor scenes I've found it's much easier to get decent looking shadows with stencil shadows than with shadow maps.
Humus has some nice shadow demos. Check 'em out. You'll need a Windows machine to run them, but he includes the source code.
Sorry to stray a bit off topic, but is there a recent build of Rotrix that we could try out?
KB Productions, Car Care for iPhone/iPod Touch
@karlbecker_com
All too often, art is simply the loss of practicality.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Window drop shadows | NelsonMandella | 9 | 4,469 |
Mar 21, 2010 02:34 PM Last Post: NelsonMandella |
|
| Making 2D Stencil Shadows Soft | metacollin | 16 | 11,841 |
Jul 22, 2009 01:59 PM Last Post: NelsonMandella |
|
| softening 2d shadows | NelsonMandella | 5 | 3,949 |
May 19, 2009 04:19 AM Last Post: Najdorf |
|
| Real Time Simulation Of Fluids | Holmes | 14 | 7,750 |
May 18, 2007 08:07 PM Last Post: Holmes |
|
| Rendering 2D Shadows for Convex Shapes | Nick | 16 | 8,719 |
Nov 28, 2006 11:50 AM Last Post: memon |
|

