Jump to content
  • Advertisement
Sign in to follow this  
polyfrag

Shadow mapping light source placement problems

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

The way I'm placing the directional light right now for my strategy game is figuring out where the intersection is with the camera view and the map, and placing the light position a certain offset from that intersection and increasing/decreasing that width of the light projection in proportion to the camera zoom level. 

 

I'm getting problems when I zoom in/out/scroll around. Places that weren't in shadow before become shadowed (in specific areas, like the slopes now provide shadow cover when they didn't before) and it seems sometimes the light frustum doesn't totally cover the map area in the camera's view.

 

Is there an easy to solve these problems? Something from cascaded shadow maps?

Edited by polyfrag

Share this post


Link to post
Share on other sites
Advertisement

Are you making sure that your light's frustum (the frustum of the camera used to render the shadow map for that light) includes objects that are outside your main camera's viewing frustum? Forgive me if it's something you've already considered, but it turns out that objects outside the main scene camera's view frustum can cast shadows into where the camera can see. So, even if you can't see the shadow caster, you can still see the shadow. So, it's important that you don't try to fit the light's frustum too tightly to your camera's frustum.

 

If this is your problem, then you'll just want to expand your light's frustum. Cascaded Shadow Maps can help ensure that you are using your available shadow map resolution efficiently when you do this.

Share this post


Link to post
Share on other sites

Here's the weird shadow problem I have:

 

oddshadow.jpg

 

See how pixellated it is at the top yet smooth at the bottom? How could that be?

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!