Three-gpu-pathtracer: A modular shader-based path tracing extension for three.js!

Hello! Over the last several months I’ve been working on a high fidelity, physically based path tracer based on my three-mesh-bvh project and have just released the initial version! It includes material features such as transmission, textures, normal maps, metalness, GGX specularity, environment maps, tiled rendering, and more! There are a few demos to check out in the repo here:

It works by packing the BVH and geometry details into textures and implementing a raycasting algorithm in a shader to path trace the scene. There’s still a lot more to do to improve performance, compatibility with three.js meshes and materials, and generally improve the quality of the project so I welcome anyone who is interested in contributing to come learn with me! I’m happy to offer guidance and point people in the right direction to get something implemented. And of course any feedback is welcome! I’m looking forward to seeing the project grow.

And as always please do share if you wind up building something with it!

transmissive gelatinous cube

material demos

Lego models, of course

other demo models

Garrett

14 Likes

Very pretty, well done!

1 Like

It looks awesome.
In your opinion what would be the main use cases for something like this on the web?

1 Like

All kinds of things, I think. Architecture visualization, product visualization / configuration viewers, real time light map or ao map baking, scene editor rendering, procedural three.js art rendering, among others!

Here are some new demos and test models! I’ve added a gem / jewelry demo model which you can check out here:

Jewelry Demo

And an interior scene with a lot of reflective, refractive, and metal surfaces lit entirely from emissive surfaces:

Interior Demo

4 Likes

The second version of three-gpu-pathtracer has just been released!

It includes a few new features including depth of field support and support for skinned and morph target meshes.

New Demos

Depth of Field Demo

Skinned Geometry Demo

Morph Target Demo

Depth of Field

Animated Geometry

trex robot

7 Likes