Replies: 1 comment
-
You'll need to enable shadow maps on the renderer. R3F's Also, prefer not to create objects in the body of a render function, furthermore you can configure your camera via the <Canvas shadows camera={{ fov: 45, near: 0.1, far: 100, "position-y": 15 }}>
<OrbitControls
minPolarAngle={0}
maxPolarAngle={Math.PI / 2 - THREE.MathUtils.degToRad(1)}
/>
<directionalLight
position={[0, 5, 2]}
castShadow
color={0x602376}
intensity={1.0}
/>
<StadiumScene />
</Canvas> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I created a simple scene that contains
Directional Light
,Orbit Controls
(for camera control), and aGroup
that contains meshes:In
StadiumScene
component, it only has Sphere and Plane objects:However when running it on the browser, the shadow behind the Sphere didn't cast on the plane

Did I do something wrong or miss syntax? I used
React 18.12.0
,three 0.145.0
,@react-three/fiber 8.8.8
and@react-three/drei 9.32.7
Beta Was this translation helpful? Give feedback.
All reactions