-
Hey, I've got a scene built, following a book on Three that i'm reading. I converted the example code to react-three-fiber, but I only have one of the objects (Box) casting a shadow. Given the code, i'd expect the Sphere to cast a shadow as well. Could anyone take a look and see if they can spot the issue? Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
drcmda
Jan 27, 2022
Replies: 1 comment 1 reply
-
it does cast, but directionalLight has an extremely small frustum by default (just one unit) <directionalLight
castShadow
position={[5, 5, 5]}
shadow-camera-far={50}
shadow-camera-left={-10}
shadow-camera-right={10}
shadow-camera-top={10}
shadow-camera-bottom={-10}
/> and as of v8 you can attach nested objects <directionalLight castShadow position={[5, 5, 5]}>
<orthographicCamera attach="shadow-camera" args={[-10, 10, 10, -10]} />
</directionalLight> |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
RCopeland
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it does cast, but directionalLight has an extremely small frustum by default (just one unit)
and as of v8 you can attach nested objects