#Changing Shadow Radius on Directional Light | React Three Fiber

5 messages · Page 1 of 1 (latest)

north stirrup
#

I am trying to change the shadow radius on a directional light I've made in react three fiber but I don't seem to able to do that. Any help would be greatly appreciated.

This is what I have so far but it doesn't seem to work:

const meshRef = useRef()
useEffect(() => {
        if (meshRef.current)
            meshRef.current.shadow.radius = 5
    }, [meshRef]);

return (
        <directionalLight ref={meshRef} width={30} height={30} lookAt={[0, 0, 0]} position={[0, 30, 0]} intensity={0.5} castShadow >
            <orthographicCamera attach="shadow-camera" args={[-50, 50, 50, -50, 60]} />
        </directionalLight>
    )
summer galleon
#
<directionalLight shadow-radius={5}>
  <orthographicCamera attach="shadow-camera" args={[-50, 50, 50, -50, 1, 1000]} />
</directionalLight>
#

you can set shadow-radius={5} directly, why the effect?

#

lastly -50, 50, 50, -50, 60 this sets camera near to 60, not sure if that's the intention