Troubles with shadows in basic three.js scene

Hello, whomever is reading this I hope you are doing well.

I am currently learning three.js and have ran into an issue with getting shadows to work within my scene. Other forums or videos I’ve seen of three.js tutorials work for others but when replicating it within my application it doesn’t work.

I was hoping someone a bit more knowledgeable of three.js may be able to assist me. I’ve tried to get this to work within several different projects and no attempt has seemed to work so far.

scripts.js (2.1 KB)

On the plane, are you using MeshBasicMaterial - which is not affected by lights?
Are you using an AmbientLight which overwhelms the DirectionalLight?
Those are two common errors.
If that is not the problem, please share your lighting/shadow code and we should be able to figure it out.

//ambientLight.castShadow = true;
plane.recieveShadow = true; - > plane.receiveShadow = true;

2 Likes

Thank you so much for catching that typo within my code. Went back to my previous project to and it was the same issue. I’ll have to watch my spelling a bit more closely.

1 Like