react-three-lgl icon indicating copy to clipboard operation
react-three-lgl copied to clipboard

Auto convert to LGLTracer's directionallight

Open SrinivasPrabhu794 opened this issue 4 years ago • 3 comments

Hi,

Are the original three.js DirectionalLights auto-converted to LGL Directionalight at this moment?

SrinivasPrabhu794 avatar Jan 23 '22 10:01 SrinivasPrabhu794

i am not quite sure, the lgl documentation is very scarce. you can force it by doing:

import { Canvas, extend } fron '@react-three/fiber'
import { Raytracer } fron '@react-three/lgl'
import { DirectionalLight } from 'lgl-tracer'

extend({ DirectionalLight })

<Canvas>
  <Raytracer>
    <directionalLight />

or if you want it to be optional

extend({ LglDirectionalLight: DirectionalLight })

<lglDirectionalLight />

but i don't really see a difference when i skip the extend.

drcmda avatar Jan 23 '22 13:01 drcmda

i was wrong, turns out it completely ignores threejs lights. so the extend thing definitively works.

drcmda avatar Jan 23 '22 22:01 drcmda

Thank you @drcmda. I shall try this out and let you know

SrinivasPrabhu794 avatar Jan 24 '22 16:01 SrinivasPrabhu794