in stable mode the scale was ever so slightly varying with the
camera position, because it was calculated from the camera frustum in
world-space, this variation was amplified when the camera is far from
the origin, which eventually caused the modulo needed for snapping the
shadowmap projection to widely vary, leading to the instability.
We now calculate the camera frustum sphere in view space, which is
guaranteed to be constant. If "shadow caster mode" is chosen, we
quantize the scale a little bit so it stays constant.
The snapping code itself has been cleaned.