Jump to content
  • Advertisement
Sign in to follow this  

Exponential Shadow Maps - better precision?

This topic is 2757 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm writing a brief sample app demonstrating exponential shadow maps, and I wanted to sanity-check a thought which occurred to me.

The standard derivations of the technique (e.g. here: [font=Calibri, sans-serif][size=2]Exponential Shadow Maps[/font]) always describe a precision limit of c ~ 80 for the constant c used in the expression exp(-cd). The limit is because you reach the min representable (non-denorm) value in a float32.

However, exp(-cd) is always <=1, since the depth d is >=0. So we aren't using any of float32's precision outside the [0,1] range.

I want to suggest that we replace exp(-cd) by exp(-cd+A), where A is chosen so that exp(A) is as large as can be accommodated without overflow (this is 128 * ln(2) ~ 88). The whole derivation should still hold as before. Also there should be no noticeable change in the quality of the previous results, since we are simply shifting the exponent, without changing the mantissa. Now it's possible to use c around twice as large as before.

Anything wrong with this?


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!