I was wondering how I could detect the edges of my shadow map texture in my fragment shader.
I took a look at the following tutorial on youtube: https://www.youtube.com/watch?v=9sEHkT7N7RM But in that guy's case, the solution depends on the camera position. I would prefer not to depend on the camera position.
The problem: If an object moves out of the area that was sampled by the shadow map rendering pass, the object's shadow gets clipped (normal behavior). So, if I could know that the current fragment's position is close to the shadow map border, I could add a fadeout-mechanism of some sort.
Cheers and thanks in advance!