Originally posted by Nakoruru:
I figured that is what you where trying to do. Ysaneya, how do you calculate the distance between the shadowed surface and the occluder's silouette?
One idea off the top of my head is to project a depth map (like in shadow mapping) into the scene and calculate the difference between the occluder depth (from the shadow map) and occludee depth from the light (perhaps from a 1d texture) and store it in the alpha.
The the difference between the occluder and the occludee depth from the light, not the absolute distance from the light that is needed to calculate how blurry a shadow should be.
The bigger the difference, the bigger the light appears relative to the occluder, the blurrier the shadow should be.