I have a very weird bug with the CSM shadows (using r181) regarding very large objects (building-sized) that seem to go out of the shadows’ FOV, or upon inspecting with CSMHelper, seem to break when crossing a cascade. I know my way around shaders and rendering stuff but I have no idea where even to begin to debug this since CSM and shadow stuff is my weak spot. Would like to know if anyone saw something similar and might have any ideas where to investigate this issue.
Video: https://youtu.be/cVhgxqtigu8
Video with CSMHelper: https://youtu.be/Ik7JyDMwZ68
Edit: forgot to post the CSM code:
const csm = new CSM({
maxFar: 1500,
cascades: 4,
shadowMapSize: 4096,
shadowBias: -0.0002,
camera: engine.camera as PerspectiveCamera,
parent: this,
lightIntensity: params.sunLightIntensity ?? 1,
lightDirection: sun.clone().normalize().multiplyScalar(-1),
});
Thanks in advance!