Sign in to follow this  
Bruno

shadow maps

Recommended Posts

Hi., I got shadow maps working (projected shadow maps) for my outdoor engine, however i'm facing a little problem. I'm using 2 shadowmaps, one of 1024x1024 that gets the shadows that are far away from the player, and 1 shadowmap of 2048x2048 that gets the shadows near the player. I'm placing the light origin above the player(at a height of 30 for the close shadowmap and at a height of 60 for the far away) and the light destination is the player itself. So, this way as the player moves around the shadows are getting updated. Now, the problem is that because the light moves with the player, the shadows move slightly in the ground, because the light is moving. One way to fix the problem is to increase the height of the light, but then i loose shadow resolution.., Any ideias on how to solve this ?? thanks, Bruno

Share this post


Link to post
Share on other sites
This is a problem with this kind of shadow, where the camera moves with the player.

Possible fixes I have found:

Blur the shadow maps, using variance shadow mapping and gaussian blur shaders..

Move the shadow camera at intervals instead of constantly, this way the the effect is less noticeable.






Share this post


Link to post
Share on other sites
Thanks Matt,

I can see bluring the shadow will help, if the shadow is too pixelated(the light high above), however moving the camera at intervals, won't that be worse ?
I mean, the player will see big jumps from one shadow position to the other.

thanks again,
Bruno

Share this post


Link to post
Share on other sites
You should be using an orthagonal projection matrix for your shadows..there shouldn't be any big jumps. I thought you were talking about the the little resolution shimmerers that normally happen..

It sounds like you are using a perspective matrix... this cant work. Use an ortho matrix.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this