-
Hi! I'm trying to fine-tune some shadows for a scene I'm working on. The shadows are generated using a function Lights() {
const [light, set] = useState()
const { shadowCameraSize } = useControls({
shadowCameraSize: {
value: 2,
min: 1,
max: 50,
step: 0.1
}
})
return (
<>
<directionalLight
ref={set}
intensity={1}
position={[5, 5, 5]}
shadow-mapSize-width={2048}
shadow-mapSize-height={2048}
shadow-camera-left={-shadowCameraSize}
shadow-camera-right={shadowCameraSize}
shadow-camera-top={shadowCameraSize}
shadow-camera-bottom={-shadowCameraSize}
castShadow
/>
{light && <directionalLightHelper args={[light, 1]} />}
</>
)
} Can it be done? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
https://codesandbox.io/s/react-three-fiber-directionallight-shadows-forked-ddqjvs?file=/src/index.js see https://threejs.org/docs/index.html?q=orth#api/en/cameras/OrthographicCamera
i recommend always having three docs open, it helps to swat issues. |
Beta Was this translation helpful? Give feedback.
https://codesandbox.io/s/react-three-fiber-directionallight-shadows-forked-ddqjvs?file=/src/index.js
see https://threejs.org/docs/index.html?q=orth#api/en/cameras/OrthographicCamera
i recommend always having three docs open, it helps to swat issues.