Hi!
I'm pretty new to this forum. I'm recently working on my editor with a directional light, the shadow tech I applied was vsm but it didn't work well under large filter radius, thus I started over and now I got no shadow upon my new vsm method.
Here is the code:
float ActualDistance = Input.depth;
float2 Moment=GetDataFromZmap2(projUV); //projUV is the texcoord transformed from the light's view matrix.
float M1sq=Moment.x*Moment.x; //spuared moment.x
float dis=(ActualDistance-Moment.x);
if(ActualDistance <= Moment.x)//-------------unshadowed
{
return 1;
}
float variance = Moment.y-M1sq …