Garrett Johnson

Garrett Johnson

@gkjohnson.bsky.social

Woven by Toyota | NASA JPL | #threejs, graphics, open source, and a bunch of fun projects!

339 followers73 following125 posts

Equal Earth projection is coming to 3DTilesRendererJS! πŸ—ΊοΈ Here it is rendering TerrainRGB & vector annotations. The LA streets look a bit less square but the projection looks great! We are updating the engine so data aligns across projections, letting you render maps however you need ✨ #equalearth

Taking a look around at some new models for three-gpu-pathtracer - good PBR assets make all the difference. All rendered in a web browser! Support for lights coming soon πŸ’‘

New random sampling method for three-gpu-pathtracer: blue noise dither sampling! It offsets a common random sequence for ALL screen samples, yielding a cleaner image in just a few samples. Screenshots are single sample scrambled sobol vs blue noise. Small writeup belowπŸ‘‡

View full thread

You can see some of the artifacts at 15spp that become apparent in Sobol vs the new approach, which are particularly noticeable when using an env map with a lot of bright spots. But depending on your use case or scene it can be a big improvement & will converge to the same image

New random sampling method for three-gpu-pathtracer: blue noise dither sampling! It offsets a common random sequence for ALL screen samples, yielding a cleaner image in just a few samples. Screenshots are single sample scrambled sobol vs blue noise. Small writeup belowπŸ‘‡

It uses the same Sobol scrambled sequence for all pixels, mixed with a 1D blue noise sample seed. This scatters rays in common directions across the screen-space BN pattern, which gives a smooth appearance quickly, though without full coverage (as seen with 1 sample here).

v0.9.11 for three-mesh-bvh has been released! And brings an overhaul of compute-shader functionality to improve performance, flexibility & platform support! πŸš€ You can use the hooks to write your own compute traversal for custom queries, as with the shapecast function. 1/2 🧡

By using a kind of clustered BVH - effectively a TLAS BVH pointing to BLAS subtrees instead of roots - I've finally got the framerate up in the pathtracer. It now updates at 120 ticks per second, keeping the UI completely responsive while rendering 2/2

Just finished adding anisotropy support to the WebGPUPathTracer for three.js - slowly but surely getting to feature parity with the WebGL version. All with better ergonomics, features, and performance! Transmissive materials still need work though...πŸ’‘

Slowly getting some additional annotations & metadata from vector tiles in 3DTilesRendererJS. Here, icons are layered on top of Google Photorealistic Tiles data so you can find landmarks & restaurants as you navigate. Road labels are up next! πŸ—ΊοΈ

Garrett Johnson@gkjohnson.bsky.social

Support for @mapbox.com and @protomaps.com vector tiles are coming to three.js in 3DTilesRendererJS! You can now bring vector layers in as 3D Tiles overlays to customize map coloring for visualization and branding. Or just to make something a bit chaotic 🎨🌏

Settling icons on arbitrary tiles is tricky so to do this generically, they iteratively update via raycast whenever tiles change. And three-mesh-bvh is used to keep things fast.

Six years later this is still one of my favorite outline effects especially for hard surface models like CAD & architecture. And now it works with three.js' WebGPURenderer thanks to a contribution from "cmhhelgeson" on Github!

It's been almost exactly 6 years since I started the 3DTilesRendererJS project at JPL. This past year alone, downloads jumped 5x to over 20,000 per week. Huge thanks to everyone who has contributed and looking forward to seeing what else people build this year! 🌏✨

Got the path tracer running on mobile with 16-bit output using Kahan-summation & residuals packed into 8 bits. I'm a bit worried about precision loss so I'll probably replace this with something else. But it still looks quite good on these simple scenes! πŸ¦€ #threejs #raytracing #webgpu #javascript

Garrett Johnson@gkjohnson.bsky.social

Happy to report that Lego LDraw models are working #threejs #raytracing #webgpu #lego

Per-instance color support 🫧

Garrett Johnson@gkjohnson.bsky.social

Using the recently-added "ObjectBVH", geometry instancing is also now supported. So complex scenes like these can finally be rendered without merging it all into a single geometry ✨ #threejs #raytracing #javascript #webgpu

Using the recently-added "ObjectBVH", geometry instancing is also now supported. So complex scenes like these can finally be rendered without merging it all into a single geometry ✨ #threejs #raytracing #javascript #webgpu

Garrett Johnson@gkjohnson.bsky.social

Environment map sampling & backgrounds are now supported in the WebGPU path tracer! Slowly but surely we're getting features ported over. Thanks to "TheBlek" for getting this added! #threejs #webgpu #javascript #raytracing

Environment map sampling & backgrounds are now supported in the WebGPU path tracer! Slowly but surely we're getting features ported over. Thanks to "TheBlek" for getting this added! #threejs #webgpu #javascript #raytracing

Garrett Johnson@gkjohnson.bsky.social

We have a first pass at a wavefront path tracer! You can see the artifacts of thread groups pulling rays off the ring queue to trace in this slowed down video. It's not much, yet, but Im excited for what this will bring in terms of performance scalability✨ #threejs #raytracing

We have a first pass at a wavefront path tracer! You can see the artifacts of thread groups pulling rays off the ring queue to trace in this slowed down video. It's not much, yet, but Im excited for what this will bring in terms of performance scalability✨ #threejs #raytracing

Garrett Johnson@gkjohnson.bsky.social

Spent some time today looking into WebGPU support for three-gpu-pathtracer - compute is going to make this a lot easier than WebGL. Looking into Wavefront Pathtracing next ✨ Thanks to "TheBlek" on Github for helping to get this started! #threejs #raytracing

Spent some time today looking into WebGPU support for three-gpu-pathtracer - compute is going to make this a lot easier than WebGL. Looking into Wavefront Pathtracing next ✨ Thanks to "TheBlek" on Github for helping to get this started! #threejs #raytracing

I revisited my parallel IK system for the first time in awhile to make some ergonomic improvements & got perf improved by over 50% in some cases πŸ¦ΎπŸ€– I still have some more improvements in mind, though, when I have some more time. Repo link below πŸ‘‡ #threejs #webgl #robotics

Using the same scene-wide BVH you can run accelerate frustum culling, as well. With this 500,000-instance BatchedMesh culling runs in less than 1/8th the time πŸš€ #threejs #gamedev

Garrett Johnson@gkjohnson.bsky.social

With the recent three-mesh-bvh changes you can finally make a full scene-wide BVH to accelerate physics, raycasting, etc. And at some point Pathtracing 😁 Its just a prototype so far but it "just works" with objects and batched instances in a single structure. #threejs #gamedev

With the recent three-mesh-bvh changes you can finally make a full scene-wide BVH to accelerate physics, raycasting, etc. And at some point Pathtracing 😁 Its just a prototype so far but it "just works" with objects and batched instances in a single structure. #threejs #gamedev

With the new abstractions in three-mesh-bvh, making a custom BVH is easier than ever! SkinnedMeshes can now have one created directly, leading to an over 2x perf improvement on update vs creating a new static mesh. πŸš€ What else needs a BVH? 1/2 πŸ‘‡ #threejs #webgl #gamedev

It's been a long time coming but the latest version of three-mesh-bvh brings support for out-of-the-box Line & Point cloud BVH support! Now all your geometries can be fast πŸš€ 1/3 #threejs #webgl #javascript

It took a lot of refactoring but the new BVHs support accelerated raycasting and custom shapecast queries all with the same underlying construction logic and settings. Hopefully some more BVH types coming soon ✨ 2/3

Im seeing a difference in behavior with deployed code on @github.com pages vs the same files locally. Has anyone seen this before? Left is edge generation run locally & right is on Github pages from one of my #threejs projects. Notice the extra lines. 1/3 πŸ‘‡ #webgl #javascript

I've tried pushing versions that don't bundle the code (using import maps), adjusting epsilon values, made sure I'm running the exact same code, etc. This happens in Firefox & Chrome. Is there anything that GHPages or a static server could be doing to the file to cause this? 2/3

Thanks to amazing work from "SoftwareMechanic" on Github, the 3DTilesRendererJS project now supports GeoJSON overlays! Perfect for draping GIS datasets - region outlines, property boundaries, or GPS paths - onto any 3D Tiles data set πŸ—ΊοΈβœ¨ #threejs #gis #3dtiles #maps #javascript

More graphic screenspace SDF effects πŸ”πŸ€– #threejs #webgl #gamedev #realtimeVFX #javascript

Garrett Johnson@gkjohnson.bsky.social

These are some of the more basic effects you can make, I think, but these are outline & glow effects made with the Jump Flood SDF buffer - link to the repo below! πŸ‘‡ #threejs #webgl #gamedev

Taking a dive into Bezier curves for fast SVG & font rendering. The curves are evaluated in a fragment shader so they're resolution independent with single-pass antialiasingπŸ“ˆ Cubic curves next! Though it looks a bit more complicated... #threejs #webgl #gamedev #javascript #svg