shadow maps

Started by
2 comments, last by Matt Aufderheide 17 years, 8 months ago
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
Advertisement
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.






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
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.

This topic is closed to new replies.

Advertisement