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.28k stars 125 forks source link

Debugging: Simplification / debug approaches #476

Closed gkjohnson closed 5 months ago

gkjohnson commented 6 months ago

While looking through #475 it occurred to me that there are a few things about the code that we could simplify that may help with the MacOS rendering issue:

cc @robertoranon

gkjohnson commented 5 months ago

Note that both gpu path traced examples in the three-mesh-bvh project still work. And swapping to the "OpenGL" backend from "default" (metal) does not fix the issue.

gkjohnson commented 5 months ago

It seems that commenting out the "directLightContribution" function fixes the issue. All other FEATURE_MIS code blocks are still enabled.

// next event estimation
#if FEATURE_MIS

    gl_FragColor.rgb += directLightContribution( - ray.direction, surf, state, hitPoint );

#endif
image

edit

And only commenting out this also fixes this.