We aren't prepared for GOOD shadows!

We are at 21th century and still we haven’t an ultimate shadow algorithm.

  1. Shadow volumes requires a lot of fill rate, are CPU expensive, provides “hard shadows” and too slow soft shadows. Silhouetting is too complex and tedious…And more if tesselating is required!
    Auto-shadowing should be disabled in order to prevent bad casting artifacts.

  2. Shadow maps haven’t good quality at reasonable dimensions ( 256x256 or 512x512 pixels ). A glReadPixels it’s slow, and glCopyTeximage2D functions doesen’t work in certain cards. Biasing it’s a problem, like “perspective adjusting” whe you render at light-view. Also, requires multitexturing or multipass rendering…

  3. Projected planar shadows are good for portals-room-walls but not for a landscape-exteriors 3D engine. Auto-shadowing is too difficult. Double blending could occur.

  4. Anyone knows a GOOD ( realistic, fast and not complex )algorithm for shadow casting? I wonder why NVidia, ATI, etc… doesn’t offer a solution via light model. Don’t you?

There are very good reasons that we don’t offer a “shadowed” light model – it’s a global lighting problem, whereas CG lighting models are generally local lighting models.

That said, you could use vertex programs to implement a per-vertex shadow lighting algorithm. You’d send down ray intersection test results as one of the vertex attributes, and you’d use them to modulate each light’s contribution. This still requires ray intersections in SW. Ick. On the bright side, this allows soft shadows, because the contributions don’t have to be just 0 or 1, they can be arbitrary values.

We do have other ways that we’re thinking about to improve shadows in the future, but it is a tough problem.

  • Matt

One day we’ll have the POV or the 3DS Max raytracer in hardware… (NV75 ??)



Matt, you can’t be serious about this vertex shadowing. It would be extremely noisy around edges. You must admit that your hw-lighting has limitations.

I think shadowmapping works pretty good, and the resolution is not limited in any way. If combined with a fade over distance, the result could be perfect

That “X-Isle” demo on the nVidia site uses a software version of the method that matt discribes. It doesn’t look all that bad. And they use it for animated creatures, which means shadow maps are sort of hard to do anyways.


Wow, what a nice demo. The nice part is the detail-level and texturing. The chrome/reraction/whatever dino is somewhat irrelevant.

The shadows are just too ugly. In perhaps 5 years the polygons will get small enough for this method to work. I guess it’s a pretty effecient method though.

The shadows in Drakan and Rune are pretty great. If adding some fading with distance it would work very well.

I’m not saying it’s a perfect method, but it might be interesting theoretical curiosity.

  • Matt

doing global illumination by vertex has been done for years, it is called radiosity.
And the results wasn’t very impressive in terms of quality of shadows : shadow leak is a very disturbing artifact. Objects seems to fly over the ground…
Another method to do shadows with basic polygon rendering, is to generate shadows polygons, or to use discontinuity meshing.
This method produces sharp shadows, and are quite complex to implement but that’s another solution.

Radiosity is extremely realistic, but tough to do realtime. It is not bound to be done on a vertex basis, but could use lightmaps as well.

What do you think about photon maps?
It’s also a global method, and it can produce lightmaps as well.

lightmap was very interesting on low poly model, and on ‘big’ poly (like the levels in the quake series)
with more complex models, you can’t use one lightmap per poly.
so we have to find new method to overcome this problem. I think a mixing of projected shadow map and per-pixel lighting will be the future.
For radiosity, it is not realtime but it use per vertex lighting for rendering, as mcraighead wants to do for shadows. And i insist, per vertex lighting cause shadow leaks, and that’a very ugly artefact.
Finally, photon map is a very clever idea for global illumination, but that’s another problem…