Jump to content
  • Advertisement
Sign in to follow this  
pasman

Shadow maps and the sun

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

Hi,I managed to implement shadow maps in my engine and it works with spotlights near the shadow casters, but I want the sun to shadow the main character. Here comes the depth buffer precission issue, when i render from sun I "don't see" the character in the depth texture. I understand that sun light is usually implemented as a directional light (only the light vector) but then how to create the depth texture? I also tried reducing the distance from the sun but I get weird results.. So anyone has any suggestions on how could i achieve shadowing from the sun using shadow mapping? Thank you.

Share this post


Link to post
Share on other sites
Advertisement
yea thats a limitation of shadow mapping. Everything outside the view frustum of the light will get clipped. To combat that, you can render a cube env map around your light source. There is also a technique called dual paraboloid mapping scheme which can be used for shadow mapping.

Share this post


Link to post
Share on other sites
You can render the sun as an orthogonal projection, and map the distance function to always treat z == 0 in the light space as low as possible.

In my game, I have a top-down view, and only dynamic things cast dynamic shadows, so I don't have to worry about the terrain getting in the way, so I make a separate little shadow map for each character.

Share this post


Link to post
Share on other sites
Quote:
Original post by SimmerD
You can render the sun as an orthogonal projection, and map the distance function to always treat z == 0 in the light space as low as possible.


Thank you for the reply but can you elaborate on that please?:)

Share this post


Link to post
Share on other sites
An orthogonal projection, iirc, is when instead of having a frustum-like viewpoint, the projection is more shaped like a rectangular prism. Google should turn up some answers on that, or there should be a D3DX function for generating that.


Quote:
yea thats a limitation of shadow mapping. Everything outside the view frustum of the light will get clipped. To combat that, you can render a cube env map around your light source. There is also a technique called dual paraboloid mapping scheme which can be used for shadow mapping.


Uhm, he was talking about directional lights, not omnidirectional/point lights, which both cubemap and DPmap algorithms are designed for.

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!