3 Matching Annotations
- Feb 2024
-
stackoverflow.com stackoverflow.com
-
A loaded glTF asset does not cast shadows if you just set gltf.scene.castShadow to true. You have to do this for recursively for all meshes.
-
You have not configured the shadow frustum for your instance of DirectionalLight correctly. Try it with this code: var dlight = new THREE.DirectionalLight( 0xaabbff, 0.3 ); dlight.position.x = 0; dlight.position.y = 750; dlight.position.z = 0; dlight.castShadow = true; dlight.shadow.camera.top = 2500; dlight.shadow.camera.bottom = - 2500; dlight.shadow.camera.left = - 2500; dlight.shadow.camera.right = 2500; dlight.shadow.camera.near = 1; dlight.shadow.camera.far = 1000; dlight.shadow.mapSize.set( 2048, 2048 );
-
Since MeshBasicMaterial is an unlit material, it can't receive shadows. That means you should use e.g. MeshPhongMaterial for your tiles and floors otherwise you won't see any shadows.
-