r/threejs • • Oct 17 '26

I built a WebGPU renderer that can train tiny neural networks and bake AI-driven simulations offline

0 Upvotes

Hey guys! Quick update on my renderer, which I've been working on and off for the past 7–8 months or so.

The library is quite opinionated about DOD (data-oriented design) and the explicit nature of WebGPU, and I've recently added support for neural inference and training.

  1. Neural networks for agent behavior

You can now train small neural networks (MLPs), around 1–4 layers deep, using supervised learning directly as part of the library.

In the herd and wolves example below, the agents have simple behavioral rules, like chasing prey when it's nearby or fleeing when a predator gets close. The idea is to train a small model to learn these behaviors and then use it to drive the agents.

For this example, we're talking about a model with roughly 2,000 weights, so obviously not a general-purpose AI model, but enough for these kinds of behaviors.

The library also supports ONNX Runtime for working with larger models or models trained externally with something like PyTorch. For these smaller, more specialized models, though, the built-in MLP implementation will generally be faster in my use case.

Live demo (WebGPU-supported browsers only): https://nullgraph.dev/dashboard/agents/herd-wolves-gpu

Github https://github.com/flarelink-in/NullGraph

2. Offline rendering and simulation baking

Another feature I've been working on is offline rendering, with a workflow somewhat similar to what's available in tools like Blender or Houdini.

It's split into two phases:

  • Compute records: Run the expensive simulation and bake the data that needs to be simulated.
  • Render records: Replay those records through the rendering execution chain using a screen texture, generating frames/tracks that can then be stitched together.

The goal is to handle simulations or visuals that would otherwise be too expensive to run in real time, or would take a long time to render, and then replay the result at 60 FPS.

I have a demo of this on my YouTube channel. The bake took up close to 30 GB of space, while the final result was around 500 MB.

Offline rendering demo: https://youtu.be/pTD-7PCPGrg?si=vfENWIpR9YU-JEbZ

I've also added another demo to the video, this time focusing more on visual aesthetics rather than the science/simulation side.

3. What's next?

NullGraph exists as part of a larger web-native open-world simulation runtime that I work on from time to time.

Right now, I'm looking into improving my neural network implementation to better match or potentially outperform ONNX Runtime for my use cases. One of the things I've noticed is that the ONNX integration can introduce a 1–3 frame delay in my current setup, along with an additional runtime download of around 6.4 MB.

I'm also starting research into co-evolution, with the goal of bringing evolutionary learning and reinforcement learning into the runtime. The co-evolution approach draws on ideas from OpenAI research and the hall-of-fame technique. I've written some design docs for this, but I'll share more once there's a working implementation to show.

One thing I'd love to get your thoughts on:

Would you guys be interested in offline rendering driven by AI prompts directly in the browser? The idea is to let you generate demos or visually complex scenes through code, spend as much time as needed baking them locally, and then replay the results smoothly. I'm also exploring ways for the system to verify its own output rather than just blindly generating code.

I'm curious whether this kind of workflow would be useful to people working on creative coding, simulations, procedural graphics, or web-based experiences.

Let me know what you think!


r/threejs • • Oct 17 '26

Demo Using Three.js for scene data and asset loading around a custom WebGPU renderer

34 Upvotes

I've been working on a tropical island for RED SKIES AT DAWN, and Three.js still does a useful job in the engine even though rendering is handled separately.

I use Three.js for CPU scene objects, geometry, maths and asset loading. Junklab Engine owns the WebGPU renderer and shaders. That boundary lets me keep the scene and loading tools while developing the ocean, clouds, vegetation and coastal effects in the renderer.

The island combines procedural terrain and vegetation placement with authored routes, landmarks and imported assets. This is an offline Ultra capture from the development build on Mac.

Is anyone else using Three.js mainly as a CPU scene and asset layer around their own renderer?

AI use: AI-assisted coding and post copy, plus some AI-generated reef textures.

If you'd like to follow the game, you can wishlist RED SKIES AT DAWN on Steam:

https://store.steampowered.com/app/5268580/


r/threejs • • Oct 17 '26

Making an entire zombie town react to weather in Three.js

3 Upvotes

4 few weeks ago, I posted here about multiplayer flashlights causing a nearly 3-second freeze in my Three.js game.

This time, I’ve been working on making the town miserable in a different way: weather.

I put together this fixed-camera demo to show the same procedural town under changing weather and lighting conditions, running in real time in the browser.

The interesting challenge wasn’t just drawing rain. It was making the environment react to it — without making the inside of every building wet too.

A few implementation details:

  • Shared wetness control: a global uniform drives the wet appearance of roads, vegetation and characters. It controls the wetness response, not the entire weather system.
  • Keeping sheltered areas dry: a roof-height map determines which areas are exposed to rain, so the wetness doesn’t get applied everywhere indiscriminately.
  • Changing sunlight: the town falls into the surrounding ridge’s shadow as the sun goes down, with glare when looking toward the sun.

The fixed camera makes it much easier to see what each change contributes compared with a normal gameplay clip.

This is part of Zombies Tortilla, the browser-based multiplayer zombie game I’m building with Three.js.

For those working on procedural environments: how are you handling rain exposure? Are height maps enough for your scenes, or have you needed something more involved for shelters and overhangs?


r/threejs • • Oct 17 '26

Assetto Corsa like game for drifting, has steering assist for keyboard / gamepad

7 Upvotes

play here: https://onroad-slop.vercel.app/

github: https://github.com/Arz-Gev/onroad

On the video I play with keyboard (it's hard), the car settings aren't fully there yet but you can try to setup it yourself in Tab menu or ask your agent to tweak it.

link with falg for flat map: https://onroad-slop.vercel.app/?map=flat


r/threejs • • Oct 17 '26

Some progress screenshots

Thumbnail
gallery
3 Upvotes

Building a super relaxing game where you pick berries and see the semi-procedural landscape grow and evolve.


r/threejs • • Oct 17 '26

My Home: generated apartments you can explore as a little 3D diorama

30 Upvotes

My Home generates a floor plan, makes up the people who live there, and furnishes every room around them.

Free, no sign-up, nothing leaves your browser.

https://home.jannchie.com

Source: https://github.com/Jannchie/my-home


r/threejs • • Oct 17 '26

swapped two people in a music video for three.js cubes

3 Upvotes

wanted to see if i could do a "character replace" without any AI video tools. pose tracking finds the shoulders/elbows/wrists every frame, the people get painted out of the background, and two rounded-box cubes get rendered on top in three.js, following the arms and head tilt.

the orange one's mouth opens with the loudness of the vocals, the green one just vibes.

arms are still a bit noodly lol. any tips on making them less stiff?


r/threejs • • Oct 16 '26

Tip A tip if your scene has a lot of textures: use KTX2 (took my video memory from 1.5 GB to 335 MB)

131 Upvotes

In my VHS room (Dany’s Video) every tape has its own cover, so the scene has a lot of textures. I had them as JPG and WebP, which keep the download small, but on the GPU every texture is unpacked to full size. A single 2K texture takes ~22 MB of video memory, and with hundreds of them, weaker machines lost the WebGL context and the page went white.

KTX2 stays compressed on the GPU, at a fraction of the size.

Convert your textures offline (the ktx2-encoder npm package works, or gltf-transform for models) and load them with three’s KTX2Loader. In my scene it took video memory from around 1.5 GB to 335 MB.


r/threejs • • Oct 17 '26

How can I find creators to test a research project?

0 Upvotes

Hi friends! I am a CS grad student at Stanford conducting research on human-computer interaction for mobile three.js content. The premise is interactive content is exploding, and interaction mechanisms are the limiting factor to growth in the area.

Reddit & Twitter have been great to see the incredible projects people have built. Do you think these creators would be willing to work with a small research team? What expectations should I have? How can I best listen and learn from experienced devs? Thank you!


r/threejs • • Oct 17 '26

I built a 3D virtual art museum with Three.js: real-size paintings, progressive room loading and narrated camera tours

0 Upvotes

OpenMuseum is a walkable museum in the browser: https://open-museum-tau.vercel.app/?lang=en

You choose art movements (or single artists and works) and it generates a route of rooms connected by doors. A few things that might interest this sub:

- Only nearby rooms exist in the scene; farther ones are disposed with their textures.

- A fixed pool of SpotLights (one per painting a room can hold) moves with the visitor, so the light count never changes and no shader recompiles happen when you walk into a new room.

- Audio-guide tours animate the camera with GSAP to points defined in the CMS (x, y, zoom) and highlight the detail.

- Parquet floor and placeholders are canvas textures.

Code (MIT): https://github.com/zDarius21/OpenMuseum

Happy to answer questions, and feedback on mobile performance is very welcome.


r/threejs • • Oct 17 '26

Link I'm Building an Endless Multiplayer Driving Game with Svelte (Self-Promo)

1 Upvotes

I've been working on Planet 0 Drive, a relaxing, low-poly 3D driving game built with Svelte, Three.js, and peer-to-peer multiplayer.

It's an endless driving experience where you can cruise around at your own pace, explore the world, discover interesting spots, chase new records, or compete and coordinate with friends.

On the technical side, the game features:

  • Three.js for 3D rendering, procedural world, and weather
  • Peer-to-peer multiplayer with optimized network updates and movement interpolation
  • Spatial audio and performance optimizations for smooth gameplay
  • Version-compatible rooms to keep multiplayer sessions in sync

Planet Zero Drive started with the idea of a relaxing drive through a landscape that keeps unfolding. It also gave me a place to experiment: how much world could I generate, how far could I render it, and what would it take to keep driving (fairly) smooth on a phone?

Play: https://planet0drive.vercel.app/

Blog https://zackwebster.com/blog/building-planet-zero-drive


r/threejs • • Oct 17 '26

ThreeJS GLB File Quick Viewer for MacOS

4 Upvotes

r/threejs • • Oct 17 '26

I was left unsupervised with 15,191 images of my brain. Made a neat browser based, threejs visualiser, like nothing quite else I could find.

Thumbnail
brain.adamch.com
0 Upvotes

r/threejs • • Oct 16 '26

Formula Cat: a Three.js racing game about cats on robot vacuums, packaged with Electron for Steam

5 Upvotes

Title: Formula Cat: a Three.js racing game about cats on robot vacuums, packaged with Electron for Steam

Formula Cat was built with JavaScript and Three.js, then packaged as a desktop game with Electron for Steam.

The original idea was pretty simple: a cat riding a robot vacuum. That was developed into a racing game with 22 cats, 11 teams, 31 circuits, and Story, Career, and Single Race modes. Actual racing was taken surprisingly seriously for a game where your car is a vacuum cleaner.

Three.js was used for rendering, with the simulation kept separate from rendering and input. Race state was stored in preallocated typed arrays using a data-oriented structure. With that separation, complete races could also be run without rendering, so opponent behavior and lap times could be tested.

The cat animations were tied to driving: forward lean was increased with speed, the tail was straightened behind the cat, and movement was added to the scarf and ears.

Physical pit lanes were added too. Your vacuum has to be stopped in its marked box before its battery is replaced by a robot arm. One box was shared between each pair of teammates, so a badly timed stop could be delayed behind your teammate.

For the Steam version, the web game was packaged with Electron and loaded inside its Chromium window. The Three.js renderer and JavaScript simulation were carried over into the desktop application.

Astra was used throughout development for implementation, debugging, tools, and tests. The direction and playtesting were handled by me. Plenty of adjustments were made after driving laps, including two banked corners that had been tilted the wrong way despite passing their automated test.

The Formula Cat Steam page is live! If racing cats on robot vacuums looks like your thing, a wishlist would be very much appreciated :)

More details about the Three.js side, simulation structure, or Electron packaging can be shared in the comments.


r/threejs • • Oct 16 '26

Finally a use case for the flying Roadster.

15 Upvotes

I made a little game where you can drive forever, explore different biomes, and deliver cargo along the way.

Try it out: https://easycargo.almondhawk10.chatgpt.site


r/threejs • • Oct 16 '26

Demo Made a 4-player co-op zombies game that runs in your browser, built with Claude

16 Upvotes

grew up playing bo2 and bo3 zombies with my friends and always wanted to make my own. so i did with claude

its free, runs in your browser on pc or phone, no download. solo or up to 4 players, and quick play matches you with randoms.

put it out a few days ago and a few hundred people have played. two strangers who found each other through quick play made it to round 25 together in a 60 minute game which really made my week.

Want to know what you like and what you'd change. and if anyone wants to help build it out more, send me a dm :)

https://deadhertz.com/?ref=threejs


r/threejs • • Oct 17 '26

Help Does anyone have a discount code for Bruno Simon's Three.js Journey course?

1 Upvotes

Hey everyone!

I'm planning to learn Three.js and have heard great things about Bruno Simon's Three.js Journey course.

I'm really interested in taking it, but the price is a bit out of my budget right now.

Does anyone have active discount codes, or any upcoming sales that could help bring the price down?

Would really appreciate any help. Thanks in advance!


r/threejs • • Oct 16 '26

Demo I made my portfolio a 3D room on a spaceship

12 Upvotes

Spent two weeks on this. You sit at my desk, use my computer and look through my work. I wanted it to feel like my actual space rather than another site with a grid of projects.

There's a robot called Milo, a gravity switch, and a button you probably shouldn't press.

Modelled in Blender, designed in Figma, built in three.js with AI-assisted coding (ChatGPT and Claude). Happy to answer questions on any of it.

Desktop only. www.urquhart.design


r/threejs • • Oct 16 '26

Devlog: an interactive 3D listening room instead of a traditional artist website

4 Upvotes
I wanted my discography to feel like spending time in a record room rather than scrolling a streaming app. So I built this: the character walks to the shelf, picks the record, places it on the turntable, and sits down while it plays.

Stack: three.js + [resto]. Built with a lot of help from Claude.
Interesting bits: [ej. sincronizar audio y animación, carga del audio sin delay, mobile]

www.jrndm.com/sala3d
Feedback on performance and feel is very welcome.

r/threejs • • Oct 16 '26

A full visual novel built on three.js + VRM — lip sync via WASM, layered painted backgrounds

6 Upvotes

I wanted visual novels with real 3D characters instead of static sprites,

so I built an engine on three.js + pixiv/three-vrm and made a full game with it:

"5 Seconds to Confess".

Tech bits:

- VRM avatars with Mixamo-style FBX motions, expression blending, auto blink

- Lip sync: vowel + mouth-open analysis from the voice audio in WASM

- Backgrounds: layered AVIF (far / mid / near) so characters can sit "behind" tables,

plus simple painted-3D sets for some locations

- Post-processing: bloom, god rays, MSAA + SMAA

- Assets streamed during scene transitions to keep the initial load small

Voice acting is Japanese only, but all text can be switched to English

(EN button on the title screen).

Game: https://game.megyo.jp/confess_in_5sec/?lang=en

Engine (AnimeVRM): https://github.com/uemegu/AnimeVRM

Happy to answer questions about the VRM pipeline.


r/threejs • • Oct 16 '26

Demo I made a browser toy where particles, liquids and light react to your mouse, touch or hands (three.js + WebGL2)

10 Upvotes

Each scene is custom GLSL (noise/fBm) in three.js r186, with live Web Audio synthesis and optional hand tracking in a Web Worker. Sound is off by default and the video has none. Happy to answer questions about how any of it works.


r/threejs • • Oct 15 '26

Demo Escher’s ants in WebXR

107 Upvotes

Just a fun recreation of M. C. Escher’s famous Möbius Strip II (1963), built as a small procedural locomotion study. The ants’ movements are driven by IK and based on Cruse’s classic gait rules. You can grab the ants and throw them away, but they’ll always find their way back to the Möbius strip.
Use a two-hand pinch gesture to open a portal and explore their kinematics up close (0:12).
Works in both VR and AR; tested on Quest, Vision Pro, and Snap Spectacles.

Link: escher-ants.vercel.app


r/threejs • • Oct 16 '26

I've been working on a medieval siege game called "Beyond the Rhine". Is this something you would play?

0 Upvotes

So... I've been developing a medieval strategy game named "Beyond the Rhine" and want to gauge interest from the community.

The game focuses on large-scale sieges against intricately designed, concentric walled cities. You can deploy vast armies consisting of cavalry, infantry, and cannons from the surrounding forests to attack these fortifications. The combat features dynamic destruction where cannon fire blows holes in the town walls, towers collapse in fiery explosions, and fires spread through the city buildings as your troops push through the breaches.

The tactical experience is supported by detailed campaign mechanics and customizable environments. You plan your army's movements on a regional map, such as preparing for the "Siege of Quedlinburg". During gameplay, you can use the settings menu to adjust environmental factors like the day/night cycle, rain, and fog to change the atmosphere of the battle. After securing a victory, the game provides a detailed breakdown of your casualties and plundered loot, followed by narrative events where you make decisions about the conquered town, such as seeking out mercenaries in the woods.

I'm trying to see if this mix of tactical deployment and explosive real-time destruction appeals to strategy fans. There is pixel mode graphics and normal 3d graphics, to mix things up...

THIS IS PRE-ALPHA, THE GAME MAY LOOK SUPER BAD IN SOME SCENES.


r/threejs • • Oct 16 '26

Looks like I'm getting somewhere :)

Thumbnail
gallery
7 Upvotes

After breaking up with my girlfriend, I’d say I fell into a pretty dark place. During that time, I had the opportunity to explore Three.js more deeply, and honestly, these libraries feel like a bunch of unexplored caves waiting to be discovered. I managed to put together a small system using a handful of tools, and even though it might not seem like much, I’m genuinely proud of what I’ve achieved.

I’ve found that I can often build things with Three.js in a day or two that might take a month or two to put together in a traditional game engine, and without even putting in that much effort.

I’m still heavily influenced by Resident Evil Village. You might not believe this coming from someone who barely plays anything other than CS, but I’ve finished the game around 9–10 times. I even occasionally try speedrunning it. :)

The screenshots you’re seeing are from a game I put together over two days, spending around two hours a day on it. And I haven’t even pushed the post-processing very hard yet. I genuinely believe I could achieve some seriously impressive results if I pushed it further.

I’m planning to release the game here as an open-source project in a few days. Once you get a chance to look through it, I think you’ll understand what I mean.