Reputation: 21
I'm struggling with getting the shadows working correctly with a displacement map. I've looked the problem up on Google and as far as I understand, the displacement map distorts the vertices. So in theory there shouldn't be a problem.
However, the displacement map has no effect on the shadows.
Upvotes: 2
Views: 307
Reputation: 31026
Try using a custom depth material on your shadow casting sphere like so:
sphere.customDepthMaterial = new THREE.MeshDepthMaterial( {
depthPacking: THREE.RGBADepthPacking,
displacementMap: displacementMap,
displacementScale: displacementScale,
displacementBias: displacementBias
});
Upvotes: 4