gkjohnson / three-mesh-bvh

A BVH implementation to speed up raycasting and enable spatial queries against three.js meshes.
https://gkjohnson.github.io/three-mesh-bvh/example/bundle/raycast.html
MIT License
2.56k stars 268 forks source link

Example: Add shader-based ray tracing #291

Closed gkjohnson closed 3 years ago

gkjohnson commented 3 years ago

Planned Features

Future

Toggles

Notes #### Points of Interest - antialiasing (wk 1) - area lights (wk 2) - ambient occlusion (wk 1) - depth of field (wk 2) - caustics (??) - importance sampling / monte carlo sampling (wk 3) #### Weekend 1 **Anti aliasing** - Jitter the rays / camera for anti aliasing / multiple samples per pixel - Divide out total samples per pixel at the end. **Diffuse Sampling** - Add limit for max sampling depth - Must apply gamma correction after the fact for display - Must model energy absorption in the form of color - Start the ray a small step away from the surface to avoid self-intersections - Provides correct lambertian scattering model - Ensure we don't create a scatter ray of `0, 0, 0`.
MaartenBreeedveld commented 3 years ago

Maybe you could team up with erichlof from THREE.js-PathTracing-Renderer.

gkjohnson commented 3 years ago

Thanks! I'm familiar with the project and it looks great. My goal with this demo would just be to produce a basic proof-of-concept demo to show how it can be done with the BVH class rather than a full blown high quality renderer.