Hello, I’m working onadding directional light and its shadows after loading gltf model. Here’s my demo link: http://zhiyuan-learning.tech/demo/. In the scene, there’s always a unexpected shadow mask. Below are some code snippets I used:
Shadow has a frustum, what you’re seeing is that frustum being too small to cover your entire scene. I suggest reading documentation on directional light.
@Usnul Thanks for your suggestion! I actually make the frustum small intentionally, which let the issue to look more clearly. I have played around the example https://threejs.org/examples/?q=shadow#webgl_shadowmap_viewer, and try to change the shadow frustum small in the example but not see a similar issue. Pls correct me if some of my understanding is wrong.
One issue is - your near and far planes are quite far apart, this reduces your depth resolution, and results in inaccurate shading. I suggest you get them closer together.
Another thing is to try VSM shadows.
Lastly, it’s possible you have some weird double-layered geometry and that results in shadow artifacts on the surface.