0

I'm trying to use three.js spotlight to cast a shadow from a ball mesh (phong material) onto a floor mesh (phong material), however it doesn't seem to be working - here is what I have https://jsfiddle.net/m6t43ob5/1/

As you can see, I have enabled the shadow map using:

renderer.shadowMap.Enabled = true;

And my light is definitely casting shadows:

spotLight.castShadow = true;

My floor mesh is definitely set up to receive shadows:

floor.receiveShadow = true;

And my ball mesh is set up to cast shadows:

ball.castShadow = true;

So I just don't understand what I could be missing to cast my shadow? I've researched and it seems most other people have fixed it by adding the shadowmap enabled value but I've added this and it still doesn't work. Appreciate the help!

1 Answer 1

2

Should be:

renderer.shadowMap.enabled = true;
Sign up to request clarification or add additional context in comments.

4 Comments

if you delete it I will loose my points and others will not benefit. It is a common mistake.
I'll keep it then
To be fair- three.js warns you about pretty much everything else. Interesting that there's no warning for a capital on the E
yes because it is javascript. You might have wanted to add a new attribute to the object (which you can).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.