D
D
DevilPrado2021-09-26 20:52:03
css
DevilPrado, 2021-09-26 20:52:03

Why aren't shadows being cast in three.js?

I went through a bunch of manuals, but nothing helps
Here is a link to the code shrede35.beget.tech/house_const/index.html Turned
on the shadows in the render, in the model (FBX Model), also set the parameter to true in lighting

renderer.shadowMap.enabled = true;
light.castShadow = true;
object.castShadow = true;

But it still doesn't want to show up.
I suspect that he cannot create a shadow map for the Object, but I cannot be sure of this due to my inexperience in three.js.
Can anyone suggest an option?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
MamaLuyba, 2021-09-27
@MamaLuyba

I don’t rummage in three.js, but do you have a light source? not global, which illuminates the map, but directional? the sun is there, or the lamp?

M
Mike & Bob, 2021-09-30
@zerxx

The object on which the shadow will fall must be set:
object2.receiveShadow = true;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question