Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17625

My new variance shadow map code has a problem and it generates nothing

$
0
0

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 …

Viewing all articles
Browse latest Browse all 17625

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>