Real-Time Soft Shadows

MarkJ
Unregistered
 
Post: #1
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]

[Image: 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.
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #2
* 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)
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #3
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.
Quote this message in a reply
Member
Posts: 283
Joined: 2006.05
Post: #4
Lugaru 2 has a fantastic implementation working, by the looks of this and this. Perhaps you could ask David Rosen about how he did it?
Quote this message in a reply
Member
Posts: 269
Joined: 2005.04
Post: #5
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.
Quote this message in a reply
Moderator
Posts: 384
Joined: 2002.08
Post: #6
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.
Quote this message in a reply
MarkJ
Unregistered
 
Post: #7
Not for now...
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Window drop shadows NelsonMandella 9 5,198 Mar 21, 2010 02:34 PM
Last Post: NelsonMandella
  Making 2D Stencil Shadows Soft metacollin 16 14,535 Jul 22, 2009 01:59 PM
Last Post: NelsonMandella
  softening 2d shadows NelsonMandella 5 4,448 May 19, 2009 04:19 AM
Last Post: Najdorf
  Real Time Simulation Of Fluids Holmes 14 8,544 May 18, 2007 08:07 PM
Last Post: Holmes
  Rendering 2D Shadows for Convex Shapes Nick 16 9,493 Nov 28, 2006 11:50 AM
Last Post: memon