This image shows the artifacts I am trying to eliminate:
![](https://uploads.gamedev.net/forums/monthly_2022_10/de2d0fa2dd3d4036b6fb8ae7ab5553e0.vsm.jpg)
In this thread, it is proposed that the max value of the depths be stored in a third channel in the blur buffer. I did something similar, but a little different, I just did an extra texture read of the unblurred original image to get the exact depth at that pixel. (My “blur” currently just consists of a blit downsample of the texture mipmaps.)
float dropoff = 0.5;
float hiresz = textureLod(shadowmap, texcoord.xy, 0.0f).r;
if (texcoord.z > moments.x + dropoff) return 0.0f;
if (texcoord.z > moments.x) shadow *= 1.0f - (texcoord.z - moments.x) / dropoff;
This eliminates the errors above, but it creates strange sharp edges on other shadows:
![](https://uploads.gamedev.net/forums/monthly_2022_10/afc52a9421114b91b20b9bf4639bd686.Untitled.jpg)
I really like how variance shadow maps look aside from this problem. Do you have any suggestions how I can fix these issues?