Hi guys I´m having real troubles implementing Exponential VSM and I need someone to tell me whether this is a bug or an expected behaviour.
In my scene, I have several shadow casters and a terrain that doesn´t cast shadows.
For creating the VSM, i do the following thing:
First, i do a depth prepass without any color outputs, from lights point of view.
Secondly, i transform the depth to the exponential VSM format in a separate fullscreen pass, outputting R=WarpedDepth, G=WarpedDepth*WarpedDepth. (my implementation is exactly the same as in MJP´s great article )
Next, i apply a separable gaussian blur to the VSM shadow map.
Lastly, i apply the shadow and lighting to my scene.
Everything works fine, as long as the shadows are casted to other shadow casters, it looks smooth and great. But when the shadows are casted on the terrain (or any object which is not in the shadowmap) the VSM seems to work pretty bad, is this an expected behaviour ?.
Here are some pics that show the problem:
Left small cube = smooth shadow, since the shadow is being casted on the bigger cube
Right small cube = horrible shadow, in this case, having a big gaussian blur kernel even makes the problem worse (it makes the shadow smaller, but not smoother!).
Here is another pic with more detail.
Notice how the rooftops have super nice and smooth shadows, but the terrain (roads, etc) and basically every shadow casted on an object that doesn´t cast shadows is ugly. In the pics i made the shadowmap resolution smaller to better show the problem. But the problem is also noticeable using a 2048x2048 shadowmap
Am i doing something terribly wrong or this expected behaviour ?
Any help is appreciated, many thanks!
↧