Erich Loftis
309 posts

Erich Loftis
@ErichLoftis
Professional musician/Music teacher, Hobbyist 3D Graphics & Game Programmer - focus on real time Ray Tracing & Path Tracing on all devices with a modern Browser
Houston, Texas USA Katılım Ekim 2021
276 Takip Edilen305 Takipçiler

Fresnel equations in the wild! 😁
Massimo@Rainmaker1973
Water reveals the perfect reflection of the sunset
English

@Hyperspider2021 @Peter_shirley @threejs I hear you! 😅 But it is really worth the time to just read, even if you can't get to coding the project yourself right away.
It will give a good understanding and solid foundation to build off, when you're ready! 😊
English

@ErichLoftis @Peter_shirley @threejs I've been trying to get through that,
but instead I got college homework instead.
But it is a really fun project!
English

Here's the cover scene from @Peter_shirley 's awesome Ray Tracing In One Weekend book.
I took it a step further by adding animations to the 480 objects, plus the ability to change the shapes. Runs at 60+ fps, even on mobile!
Live Demo:
erichlof.github.io/THREE.js-PathT…
1/3
@threejs

English

and see how the BVH leaf sizes change to better fit the various objects/animations.
The technology behind all of this is my Shapes_BVH system, which uses quadric shapes as primitives, rather than triangles. ;-)
Source code:
github.com/erichlof/THREE…
github.com/erichlof/THREE…
3/3
English

@petermcneeley84 @threejs As far as number of rays, I do only 1 ray per pixel, per frame - in order to make it run at 60+fps on any device. But each pixel's camera ray does a ton of work, spawning new rays on a mini 'stack' when glass/clearcoat or diffuse is hit- kind of how Whitted did it in the 80's 😉
English

@ErichLoftis @threejs Pretty good. I assume spheres only. How many rays per frame?
English

I picked 3 inspiring Wikipedia images under 'Global Illumination' and 'Ray Tracing', and recreated them as closely as possible. You can fly the camera around, make camera adjustments, and it all renders at 60+fps, even on mobile!
Live Demo:
erichlof.github.io/THREE.js-PathT…
1/3
@threejs

English

@petermcneeley84 @threejs Thanks! On last 2 scenes, mainly spheres only, except for a large ground rectangle for both. On 1st sceme, it is uses 3 spheres, 1 metal cylinder, a large box room interior (kind of like back face culling), and two smaller white boxes, 1 holding the light and 1 for the back wall
English

And here is a link to the Three.js PathTracing Renderer, where you can find now 47 live demos (and counting!) and the complete source code for everything:
github.com/erichlof/THREE…
3/3
English

Here are the other 2 scenes in the demo. Just pick from the GUI scene menu.
Source code:
github.com/erichlof/THREE…
github.com/erichlof/THREE…
github.com/erichlof/THREE…
github.com/erichlof/THREE…
2/3


English

Saw this coming on the horizon - just a matter of time. Well gentlemen, it's been fun 😅
Chong Zeng@iam_NCJ
What if a Transformer could render? Not text → image. But mesh → image — with global illumination. No rasterizers. No ray-tracers. Just a Transformer without per-scene training. RenderFormer does exactly that. #SIGGRAPH2025 🔗microsoft.github.io/renderformer
English

Model prep in JS:
github.com/erichlof/THREE…
Final path tracing GLSL Shader:
github.com/erichlof/THREE…
9/9
English

A more permanent solution would be necessary for industry-wide Quad adoption. But I believe the benefits are worth it.
btw, the intersection algo used is by Alexander Reshetov (NVIDIA) in Ray Tracing Gems, pg 95-109
Source Code
Patch Intersection:
#L2851-L2929" target="_blank" rel="nofollow noopener">github.com/erichlof/THREE…
8/9
English

Ray Tracing hot take:
We need to move away from Triangles as primitives, and move towards Quads instead.
erichlof.github.io/THREE.js-PathT…
Pros:
* Poly-count & BVH size reduction by at least 50%
* Quads (Bilinear patches) can be Non-Planar
1/9
@threejs #RayTracing

English

