I have a problem which I believe is caused by the fragment shader code I use, however I'm not entirely sure.
The issue is this: I’ve been playing with few examples using Cesium (3D globe) and specifically, with it's shadowMap implementation. In the process, I observed that If I generate a shadowMap, and then zoom or move around on the globe, the shadow detaches or appears and then reappears. If you also observe the green and red areas, they seem to change depending on the zoom and the panning position.
For example, observe the green area in front of the start of the camera: it slowly disappears as I continue to zoom out (also, please find a link to the code demo below the images)
You could also test it by yourself in the sandcastle here:
Is this a problem with the fragment shader, or it’s something related to the shadowMap itself? Any hints as to where I could fine tune this behavior?
I'm using the latest stable version of Chrome and have a decent GPU.
shadowParameters.depth=distance/radius-0.0003; shadowParameters.nDotL=clamp(dot(normalEC,-directionEC),0.,1.);
– C Clarke Jul 11 '22 at 15:37