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!
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!
I’ve been watching your posts on Twitter and ran some of the demos… Very impressive! My next thought goes to denoisers. I’ve tried a few that are available in js but haven’t been impressed since I’m a bit spoiled playing with Intel, Nvidia, and AMD denoisers. I was curious if Intel’s open image denoiser could be compiled to wasm, but the response I got was that no one was working on it.
Do you have any thoughts on denoisers in js to compliment your pathtracer?
The next release will include env map importance sampling which should help things resolve more quickly even without a denoiser. Even so a denoiser would be nice. The “SVGF” denoiser is the one I’ve been looking in to. I have an issue here to track it if you’d like to help:
In terms of WASM - I don’t think that’s the way to go. I think we can learn from open source implementations but my impression is that these types of denoising will have to be done with shaders so I’m not sure how much WASM will really afford here.
I’ve just released v0.0.3 of three-gpu-pathtracer! The most significant changes include environment map importance sampling which prioritizes sampling brighter pixels in the environment to enable faster & smoother image convergence with sharp environment maps, support for transparent background rendering, and more! There are some breaking changes in this release so take note.
renders with harsh shadows enabled by environment importance sampling
I just released v0.0.4 of three-gpu-pathtracer! This release includes a number of fixes, improve texture offset support for materials, orthographic rendering, and more!
v0.0.5 has now been released! It comes with some big new features like clearcoat material properties, area light support, and equirect environment map rendering!
there’s 1k samples here, and you can see some very suspect pixels around the right leg. One of those (the left-most) popped white around 900 sample count, after having relatively common gradient with the neighbouring pixels.
Oh there’s some good stuff coming. The contributions coming in are amazing.
Or is the de-noising not-so-real-time?
Desnoisers can be real time but there’s a lot of different approaches to denoising - some of which are more complicated than others. But that’ll come eventually I think. All progress!
The glsl smart denoiser is the same one that was implemented in this PR. It’s good for low frequency noise but there are better solutions (some mores listed here).
v0.0.7 has been released! New features include a denoiser material, transmission attenuation support, vertex colors, thin film transparency, and improved material sampling behavior!
I’ve just released v0.0.8! There are quite a few memory-related fixes for the project, the ability to provide a separate background image from lighting, other quality of life improvements, and - most importantly - significant quality improvements to specular surface sampling! Specifically the fresnel term for fresnel has been adjust to fix an issue where mid-range rough and metallic materials were being rendered as overly-bright.
Not sure if it’s just me, but the latest 2 examples shown on the github page complete crash my graphics driver on an RTX 2080 Ti, latest drivers / Intel i7 13700k.
Other examples don’t work anymore either. Normal WebGL things run just fine.
I’m using Brave browser, which by extent is just chromium.