Original Post
I love the variance shadow map technique, but its main issue - light bleeding - is a major drawback. I was playing with it lately, and I come up with the following solution to the problem: 1 - when rendering the shadow map, use the red and green components for depth and depth^2 and in the blue component store the depth again. 2 - when blurring the shadow map, compute the red and green components normally (for gaussian blur), but for the blue component apply the max operator. This will compute the maximum depth of the surrounding pixels (for example, if your kernel is 3x3, in the blue component you'll have the maximum depth on a 3x3 surface centered on the current pixel) 3 - when computing the light factor in your pixel shader, compare the blue component with the light depth of the current pixel. If it is lower, then all surrounding pixels are in the shadow, so we set the light factor to 0. I have implemented this modification in my shader and it seems to solve most of the issues with light bleeding. I don't know if this method is new (I haven't seen it anywhere else), I just wanted to share it with you guys for further feedback. Thank you!


