Hi!
I have this scene exported from Unity in gltf format. The shadows look correct on Unity but incorrect on threejs.
Basically I have two main problems:
The shape of the shadows for one of the mesh seems to be truncated.
One mesh has another child mesh with a glass transparent material. In three.js the transparent material produces a full shadow, while in Unity light can go thorugh the material producing a more realistic shadow.
This is how the scene looks in Unity editor (glass material enabled):
This is how the scene looks in Unity editor (glass material disabled):
This is how the scene looks in three.js (glass material not casting shadows):
This is how the scene looks in three.js (glass material casting shadows):
I’ve attached the project to reproduce the result.
What am I doing wrong?
You can also use THREE.CameraHelper in order to debug the shadow camera. Very helpful to adjust the frustum. Keep in mind that the shadow quality highly depends on this feature. Tighter frustums produce sharper shadows.
scene.add( new THREE.CameraHelper( directionalLight.shadow.camera ) );