croraf
croraf

Reputation: 4728

Three.js - strange shading behaviour

Where does the vertical shadow on the left cube come from?

https://jsfiddle.net/yz0sfr35/

//I'm using:
renderer.shadowMap.type = THREE.BasicShadowMap;

enter image description here

Upvotes: 0

Views: 69

Answers (1)

WestLangley
WestLangley

Reputation: 104833

What you are seeing is pixelation in your shadows due to the fact that your shadow camera frustum is orders-of-magnitude larger than your scene.

screenshot of frustum

One solution in your case is to reduce the angle of your spotlight:

light.angle = Math.PI / 180;

Keep your shadow frustums tight around your scene for quality shadows.

https://jsfiddle.net/yz0sfr35/2/

three.js r.87

Upvotes: 2

Related Questions