For example I have 3 shadow cascades. A shadow is cast by a hill in my 2nd cascade, but the shadow itself is cast into not only the 2nd cascade but also the 1st. In the shader program, in order to locate the correct cascade, I check which bounds the Z clip space that the pixel resides within. Since the shadow was cast from the 2nd cascade, the portion of the shadow that is cast into the 1st is cut off, as shown in my image. How can I get around this? Is there something I'm missing, or is my implementation wrong?
The 1st cascade was not showing the shadow, as pointed out by DMGregory; the depth information was not recorded. This is because the viewing position of this cascade could not see this part of the hill, because the minimum Z value of the projection was only set to the minimum Z coordinate of the subfrustum in lightspace. Solution: I have now subtracted the screenfar value from the min Z coordinate, which has solved the problem. The more difficult, but more correct solution would be to do what DMGregory suggested; extrude the sub-frustum for this cascade back toward the light until it encompasses all shadow casters.