react-three-gpu-pathtracer icon indicating copy to clipboard operation
react-three-gpu-pathtracer copied to clipboard

Can't add lights to pathtracing scene

Open Vikms95 opened this issue 1 year ago • 1 comments

I'm trying to figure out how to insert lights within a pathtracing generated scene. Link to the relevant codesanbox:

https://codesandbox.io/s/react-three-gpu-pathtracer-forked-g2l8l2?file=/src/App.js

In this example, I added a red RectAreaLight within lines 116-131. I copied the methods that were mentioned on one of the repo issues: https://github.com/pmndrs/react-three-gpu-pathtracer/issues/4 https://codesandbox.io/s/react-three-gpu-pathttracer-gltf-lights-3t7bqu?file=/src/App.js

But with no luck. As you can see, the light only appears when you move the OrbitControls within the codesanbox, since that shows the normal render of the scene. When the pathtracing render is enabled (when you do not move the OrbitControls for half a second), the light dissapears. I want the light to also be visible whenever pathtracing is enabled, as in this example from the original pathtracing library, on vanilla Three.js. https://gkjohnson.github.io/three-gpu-pathtracer/example/bundle/spotLights.html

Here, the light is visible on both modes.

Vikms95 avatar Aug 17 '23 15:08 Vikms95

After trying for a while, I figured that DirectionalLight is working. How is that? I can't get SpotLight or PointLight to work with this.

Vikms95 avatar Aug 21 '23 15:08 Vikms95

Pretty sure this is an issue upsteam and only supported with Multiple Importance Sampling : https://github.com/gkjohnson/three-gpu-pathtracer?tab=readme-ov-file#gotchas

DennisSmolek avatar Sep 27 '24 06:09 DennisSmolek

This is an upstream issue . Please try suggestion by Dennis and re-open if it persists.

FarazzShaikh avatar Sep 30 '24 09:09 FarazzShaikh