Jump to content
  • Advertisement
Sign in to follow this  

Few words about trapezoidal shadow maps

This topic is 2543 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

Hello :)

I've noticed that this shadow map technique, TSM, is quite rarely mentionned.
I've implemented it, and I would like to share/discuss my (little !) experience about it :

Here's some advantages
- allow to control the accuracy of the shadow map along the depth
- no risk to miss occluders that aren't in FOV
- the trapezoid is defined to cover only the projection of the view frustum from light view : large better accuracy (*)
- the code (and more !) that computes the matrix that transforms the trapezoid into the unit square is provided by the authors : TSM recipe
- there is a simple way to eliminate the dueling-frusta problem in general case (**) : the idea is to keep a constant sized top edge of the trapezoid (at the price of a bigger wastage of the map in some cases)
- since the shadow map is in camera direction in trapezoidal space, it's possible to get it more accurate in depth extending it along one dimension only. (I use 1024x2048)
- My shadows don't cover the entire depth of the view frustum, but they can be quite far anyway. It doesn't replace cascade shadow maps of course, but it's possible with only one map to cover with controlled accuracy a high depth range anyway.
- No problem with non-constant polygon offset, because it works with light space depths.

- The main problem I have is when the projection of the front face of the view frustum is inside the projection of the far face : I use then standard shadow map , and the sunden difference in accuracy is visible.
But in my case, a more or less horizontal camera direction, it rarely occurs (at crashes sometimes).

I post a picture, but my shadows have nothing special : classic blurred shadows

I'm really curious to know what's your opinion on this shadow technique, I'm opened to any suggestion/piece of advice :rolleyes:

Best regards

-I added non-blurred standard shadow map and non-blurred trapezoidal shadow map to permit to compare
-NB : for a scene with a small depth range, it's possible to get a per-pixel accurate TSM; my aim was to get an accuracy that is enough so that blur can eliminate aliasing

EDIT (again) :
-I've replaced the two pictures with non-blurred shadow, with new ones : the difference in accuracy is more visible

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!