I tried this:
dae.castShadow = true;
dae.receiveShadow = true;
scene.add(dae);
//spotLight is defined already.
spotLight.castShadow = true;
renderer.shadowMapEnabled = true;
But the model still does not have shadows? Did I do anything wrong? Please help.
There was change in three.js (see three.js migration r51--r52):
Replaced SceneUtils.traverseHierarchy with object.traverse.
Due to that, now proper way for setting castShadow
and receiveShadow
for all objects in hierarchy is:
dae.traverse(function(child) {
child.castShadow = true;
child.receiveShadow = true;
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With