gkjohnson / three-gpu-pathtracer

Path tracing renderer and utilities for three.js built on top of three-mesh-bvh.
https://gkjohnson.github.io/three-gpu-pathtracer/example/bundle/index.html
MIT License
1.27k stars 125 forks source link

feat: add shaped area light helper #645

Open JaimeTorrealba opened 3 weeks ago

JaimeTorrealba commented 3 weeks ago

I manage to add the new visibleSurface value, but I couldn't find a way to render the texture as helper. So I believe I need some help here. I should have to modify the src/shader/sampling/light_sampling_functions.glsl.js in order to access to the src/materials/pathtracing/PhysicalPathTracingMaterial.js

(now is just adding it to the alpha channel hideous just to prove that it reach the value, of course also tried to move in other locations like using the state.firstRay, but didn't find the right one to render a texture as helper)

Area Light Path Tracing

btw, I'll be off a couple of days, so if this is not priority, with your help we can solve it :)