Hi everyone. I am new to Three and React Fiber. My problem is about a directional light shadow. I need to add directional light that casts a shadow but only some meshes create the shadow. Tried spotlight and it worked fine.
I checked every mesh’s castShadow properties. The problem is not castShadow property.
Spotlight
Directional Light
This is my Light component.
function Lights(props){
const light = useRef()
const light2 = useRef()
useHelper(light, SpotLightHelper, ‘cyan’)
useHelper(light2, DirectionalLightHelper, ‘red’)
return (
<>
<directionalLight ref={light2} intensity={0.5} position={[0, 20, 0]} shadow-radius={5} castShadow>
</>
)
}
Thanks for your help.