Jump to content


(dynamic) shadow mapping and point lights


11 replies to this topic

#1 roel

    Senior Member

  • Members
  • PipPipPipPip
  • 678 posts

Posted 26 September 2005 - 03:13 PM

Hi, I was just reading this interesting article about soft-edges shadows using shadow mapping:

http://www.gamedev.n...article2193.asp

which stated "In this article, we only deal with spot lights, but this technique can easily be extended to handle point lights as well."

My question: does this mean rendering for another five (six in total) frusta to support point lights? Or is there a smarter way?

Besides that, please some comments regarding shadow mapping in general: I'm about to build a very humble engine, is shadow mapping a good choice at all these days? Or should I stick with shadow volumes?

Thanks.

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 4782 posts
  • LocationBellevue, WA

Posted 26 September 2005 - 04:25 PM

As far as I know, the only way to do omnidirectional shadow mapping is to render six shadow maps to an unrolled depth cube map (since "real" depth cube maps aren't supported in hardware) and then write a pixel shader that figures out which part of the unrolled cubemap to look at for the shadow comparison. This is a real headache, but can be done (check my website for an example). A floating-point cubemap can also be used for the depth, but in this case one loses the benefits of doing the shadow comparison directly in hardware (e.g. automatic PCF on high-end cards).

As for shadow mapping vs shadow volumes, the trend in high-end graphics these days is definitely toward shadow volumes, as it simply requires a lot of pixel processing power be thrown at the scene, no special geometry processing needed, and also allows the possibility of doing things like soft shadows. However, in some ways shadow volumes are easier to get working, especially for omnidirectional lights.
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 roel

    Senior Member

  • Members
  • PipPipPipPip
  • 678 posts

Posted 26 September 2005 - 04:54 PM

Thanks, Reedbeta. But I guess that you mean "...definitely toward shadow mapping" instead of "...definitely toward shadow volumes"?

#4 coelurus

    Member

  • Members
  • PipPip
  • 40 posts

Posted 26 September 2005 - 08:04 PM

Dual-paraboloid shadow mapping is one solution:
http://www.mpi-sb.mp...rabec_cgi02.pdf

#5 Reedbeta

    DevMaster Staff

  • Administrators
  • 4782 posts
  • LocationBellevue, WA

Posted 26 September 2005 - 09:02 PM

Er, yes. The trend is toward shadow mapping. :-D

The dual-paraboloid shadow mapping looks interesting, but unfortunately requires the scene be sufficiently finely tesselated in order to get accurate results.
reedbeta.com - developer blog, OpenGL demos, and other projects

#6 m4x0r

    New Member

  • Members
  • PipPip
  • 25 posts

Posted 26 September 2005 - 11:21 PM

In my experience the tesselation issue isn't that big of a problem. We tend to tesselate meshes quite a bit for the current generation of hardware and the biassing that is necessary to eliminate self shadowing artifacts also eliminates the artifacts you get from dual paraboloid shadow mapping.

Max

#7 m4x0r

    New Member

  • Members
  • PipPip
  • 25 posts

Posted 26 September 2005 - 11:28 PM

Reedbeta said:

As far as I know, the only way to do omnidirectional shadow mapping is to render six shadow maps to an unrolled depth cube map (since "real" depth cube maps aren't supported in hardware) and then write a pixel shader that figures out which part of the unrolled cubemap to look at for the shadow comparison. This is a real headache, but can be done (check my website for an example). A floating-point cubemap can also be used for the depth, but in this case one loses the benefits of doing the shadow comparison directly in hardware (e.g. automatic PCF on high-end cards).

Unfortunately this isn't supported on ATI cards (and my understanding is that it never will be due to patent issues), so you need to have a separate floating point path anway. Alternatively ATI supports the DF16 fourcc render target type, but it still doesn't do the depth comparison for you.

Max

#8 Reedbeta

    DevMaster Staff

  • Administrators
  • 4782 posts
  • LocationBellevue, WA

Posted 27 September 2005 - 01:06 AM

It does the depth comparison (that's the entire point of a depth format). Just not PCF.
reedbeta.com - developer blog, OpenGL demos, and other projects

#9 m4x0r

    New Member

  • Members
  • PipPip
  • 25 posts

Posted 27 September 2005 - 03:12 AM

Reedbeta said:

It does the depth comparison (that's the entire point of a depth format). Just not PCF.
Do you know how to do this in Direct3D? As far as I know it's not possible, but I would be very interested in learning how since then I could unify the NVIDIA and ATI shadow map shaders in my engine.

Max

#10 Altair

    Valued Member

  • Members
  • PipPipPip
  • 151 posts

Posted 27 September 2005 - 03:24 AM

Reedbeta said:

It does the depth comparison (that's the entire point of a depth format). Just not PCF.
No, it doesn't do depth comparison. The entire point is that you get double speed depth writes by disabling color writes and don't need extra color surface.

Cheers, Altair
"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." - Albert Einstein

#11 roel

    Senior Member

  • Members
  • PipPipPipPip
  • 678 posts

Posted 28 September 2005 - 06:04 PM

Coelurus or m4x0r or anyone else, do you have any experience with dual-paraboloid shadow mapping? It looks promising indeed, but how fine has the tessellation to be? And how visible are artifacts when the tessellation isn't sufficient enough?

#12 m4x0r

    New Member

  • Members
  • PipPip
  • 25 posts

Posted 28 September 2005 - 09:54 PM

roel said:

Coelurus or m4x0r or anyone else, do you have any experience with dual-paraboloid shadow mapping? It looks promising indeed, but how fine has the tessellation to be? And how visible are artifacts when the tessellation isn't sufficient enough?

If your tesselation isn't high enough you will get self shadowing artifacts (dark spots) in the middle of large triangles where the correct parabolically warped geometry would pull away from the linear approximation of the warp.

For curvy things like characters you'll have no problems since these tend to have plenty of tesselation. In my experience, a 1m edge length is sufficient tesselation for a 0.01m self shadowing bias.

Max





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users