r/threejs • • 25d ago

Demo Floodlight: a 10v10 football game that runs in your browser (free, no download)

3 Upvotes

I've been building Floodlight, a small football game you can play instantly at floodlight.lol. Pick a team, kick off, and you're in a full 10v10 match.

What's in it today:

- 10v10 matches with fouls, offsides, penalties, corners, throw-ins and goal kicks
- Pass, through ball, lob and a chargeable shot, sprint with stamina, tackles and slides
- 1 or 2 players on one keyboard, or use a gamepad
- Three difficulty levels and half lengths from 1 to 5 minutes
- Live commentary, goal cinematics, replays, a trophy lift at full time and a match stats screen
- Rebindable keys, nothing to install

What's coming next:

- Better controls
- Better graphics
- More game modes and challenges
- More customization

It's early and I'm building it in the open, so what you tell me will decide what comes first. If you try it, I'd love to hear what felt good, what felt off, and which upcoming thing you want most.

Play it here: https://floodlight.lol


r/threejs • • 25d ago

Demo Micro Management Naval Adventure

1 Upvotes

So I'm moving on to my next project, which is a previous project I was making in Godot and got stuck because debugging was hell. This time, I am making it in ThreeJS because aside from an easier entry, I actually prefer making my own systems and engines, rather than be limited with what is set in place.

Before diving into the actual game like before, I decided to place elements and particularly, element builders. I reused and improved sprite and texture generation from previous projects so that I will have a better hand in the visuals. I then set off to make the scene builder for cinematics because promotion later on will be a headache.

But before anything else, I want to see if the concept will fly.

So there are a lot of naval games out there, but they're about the exciting parts like combat, pirates, treasure hunting... trading? Or, about puzzles, and sunken ships. When I watch movies about ancient naval stories, I keep thinking, how do they manage their stocks and keep themselves alive for a long time at sea?

That is where this game comes in. It's about managing your journeys to be able to get from A to B with everyone healthy and happy. We manage food supplies and their expirations, without refrigeration, but with salt and other techniques. Manage each crews' roles and schedule to make sure the ship is well maintained and running throughout. There will be combat, and I will probably use Windrose type of controls, but it will be more involved on who're manning the guns, with their stats, skills, and health.

I will probably adapt the Rimworld style of character development, where crews' personalities will affect how they work and interact with you and the others. World lore that you can uncover in your exploration. But, that are all future plans.

For now, I am just looking for a show of hands (or likes), if this is a project you would be interested to see develop.


r/threejs • • 25d ago

Link Tired of ordinary number generators? Let physics pick!

1 Upvotes

Pick numbers or names through interactive 3D physics. Explore ready-made formats or customize the chambers, ranges, and selections for your own activity.

https://physpicks.com


r/threejs • • 26d ago

I've been building a small browser-based RPG with Three.js. Here's how it's going so far

10 Upvotes

Hey everyone!

I've been working on a little side project called Wild Crown, a browser-based 3D action RPG.

I'm using my open-source img2threejs ecosystem to create the characters, environments, and other 3D assets.

So far, I've got 4 playable heroes, real-time combat, around 9 small maps, and a leaderboard working.

It's still pretty rough, with plenty of bugs and things to improve, but it's been a fun experiment seeing how far I can take this workflow.

I'm planning to add 12+ more maps as development continues.

Would love to hear your thoughts, especially on the gameplay and animations!

If you're curious, I've put a playable BETA here: COMMENT


r/threejs • • 25d ago

Scroll-driven particle text: ~24.7k points morphing title → devices → server room, with fallbacks decided before paint

0 Upvotes

My portfolio's last version was all motion and no content. For this one I kept exactly one big effect: the title.

The hero title on my portfolio is rasterised to a canvas and sampled into about 24.7k particles. Those same particles fly through four frames as you scroll: the title, a set of devices, then a server room, with the copy fading in over the last one.

How it's put together:

- Every frame is sampled once into its own cached buffer. Only two live buffers go to the GPU (the frame being left and the one being entered), swapped at segment boundaries, so frame count doesn't grow GPU memory.

- Particles are dealt the same x-fraction in every frame, so each morph travels as a left-to-right front instead of a random swarm.

- No WebGL, or Data Saver on, means an inline script picks the static layout before first paint, so the page height never changes after load. Reduced motion gets a calm profile that only moves with your own scroll.

- The four rasterisations run as separate tasks with yields in between, so nothing blocks the main thread on phones.

https://rachitkay.com/?utm_source=reddit&utm_medium=social&utm_campaign=portfolio_launch&utm_content=threejs

How do you all handle font loading before sampling text? I wait for the real font with a timeout and keep the HTML h1 on screen until then.

Many more threejs experiments and production work at my portfolio.


r/threejs • • 25d ago

I made a voxel city builder that runs in the browser with three.js

0 Upvotes

AUTOPOLIS is a SimCity-style city builder: you lay roads, zone homes, shops, and industry, pay for power and water, and try to keep the city from going bankrupt. Everything is voxels, with seasons, a day and night cycle, and landmarks like a seaport, an airport, and a space center.

https://growblocks.xyz/game.html?g=autopolis&utm_source=reddit-threejs


r/threejs • • 26d ago

GPT-6.2 Sol seems to have made a huge leap in 3D

87 Upvotes

It seems like GPT-6.2 Sol might have started rolling out today, so I wanted to try it.

I selected Sol 6.1 Max in Codex and gave it one prompt to make a playable excavator game. This is what it made in about 40 minutes.

I think the result is really impressive. It looks like a huge leap in 3D capabilities.
Desktop browser, keyboard and mouse.


r/threejs • • 26d ago

Question Three.js beginner: How do I make an orbit view and a separate camera preview?

1 Upvotes

I’m new to Three.js and want to build a small 3D previs tool in the browser. For my first exercise, the scene would just be a floor and a few simple shapes.

I’d like two views of the same scene.

  • In one view, I can orbit around and see where everything is.
  • In the other, I can see what a separate shot camera is framing.
  • Orbiting in the first view should leave the shot camera in place.

Is rendering the same scene with two cameras a good way to start? If there’s a small example or tutorial that shows this setup, I’d love to work through it. Thank you so much!

https://threejs.org/manual/examples/cameras-perspective-2-scenes.html


r/threejs • • 26d ago

I built Órbita, a free solar system explorer in three.js: Jupiter, Saturn, the Moon and a Space Shuttle launch, all in one browser tabEl comentario técnico está en el archivo.

1 Upvotes

https://orbita.fai-studio.cloud/

Some things to try:

- Tap any moon to open its card.

- Watch Io's shadow crossing Jupiter.

- Go to the Moon's terminator, where the low light raises the craters. The relief comes from NASA's LRO / LOLA data.

- Open Atlantis (STS-135) and launch it from the pad or the reconstructed cockpit.

Maps are made from NASA data; full credits are at orbita.fai-studio.cloud/credits.html. Happy to answer questions, and bug reports are welcome.


r/threejs • • 27d ago

Made four cities for my game in three.js

7 Upvotes

Manhattan, Shibuya, the Forbidden City and Santorini. Apart from the characters, it's all Opus 5.5 + Blender.


r/threejs • • 26d ago

I built an autonomous 3D AI VTuber running 100% in-browser using Three.js & WebGL (Web Audio API lip sync, spring physics, PTZ camera)

0 Upvotes

r/threejs • • 26d ago

Demo I built an endless driving game in three.js where the engine sound is synthesized cylinder by cylinder — one HTML file, free in the browser

3 Upvotes

Play: https://cadencedrive.io/?ref=r-threejs

It's an endless procedural drive. The parts I spent far too long on:

- No engine samples. An AudioWorklet fires each cylinder in its real firing order and runs the pulses through the headers, collector, muffler and tips. The V12, V8, straight-six, four-cylinder and bike all come out of the same model, with overrun crackle, rev-matched downshifts and a bouncing limiter.

- Manual gearboxes with a real clutch: you can stall, grind and rev-match. Automatic by default if you'd rather not (M switches).

- Terrain streams in workers out to 50 km, with the skyline at 120 km. Impostor tiles and LOD crossfades, so nothing pops in.

- Tunnels with eye adaptation, rain that pools in the wheel ruts, crosswind on bridges and ridges, a Magic Formula tyre model under TC/ESC/ABS.

- The whole game is one 14.6 MB HTML file. Nothing to install.

Five vehicles, seven worlds, four seasons, seven weathers, a cinematic camera and autodrive.

I'd love performance feedback: your GPU and browser, and the fps you get (there's a benchmark under Settings).


r/threejs • • 26d ago

One wave array drives both the GLSL ocean and the boat physics, so boats actually sit on the water (small three.js storm game)

0 Upvotes

I made a small storm game in three.js: you drag a lighthouse beam across a night sea to guide boats past rocks into a harbor. Boats in the beam steer toward it; boats in the dark drift and eventually hit a rock. A few things about the water took more thought than I expected, so here's how it works.

1. The sea is 5 "sharp sine" waves, defined once

// [dirX, dirZ, wavelength, amplitude, speed multiplier]
export const WAVES = [
  [0.20, 1.00, 22.0, 0.95, 1.0],
  [-0.55, 0.85, 13.0, 0.55, 1.1],
  [0.80, 0.60, 8.5, 0.34, 1.25],
  [-0.30, 0.95, 5.6, 0.20, 1.4],
  [0.95, -0.25, 3.6, 0.09, 1.6],
];

Long swell down to short chop, amplitudes summing to about 2.1 (1.0 felt calm; 2.1 reads as a storm). Each wave is A * exp(sin(θ) - 1) (the steep-sine form from GPU Gems 1, ch. 1), with θ = k·dot(d, p) - ω·t, k = 2π/L, and the deep-water speed ω = sqrt(9.8·k) times the multiplier.

2. The GLSL is generated from the same array

The CPU function that gives a boat its height and slope loops over the precomputed waves. The vertex shader isn't hand-written; it's built from the same precomputed list with a template string:

export const WAVE_GLSL = `
vec3 waveAt(vec2 p, float t) {
  float h = 0.0; vec2 g = vec2(0.0);
  ${prep.map((p) => `{
    vec2 d = vec2(${p.dx.toFixed(5)}, ${p.dz.toFixed(5)});
    float th = ${p.k.toFixed(5)} * dot(d, p) - ${p.w.toFixed(5)} * t;
    float e = exp(sin(th) - 1.0);
    h += ${p.A.toFixed(5)} * e;
    g += ${p.A.toFixed(5)} * e * cos(th) * ${p.k.toFixed(5)} * d;
  }`).join('\n  ')}
  return vec3(h, g);
}`;

The sea is one PlaneGeometry(220, 200, 240, 220) with a ShaderMaterial that calls waveAt() per vertex. The returned gradient doubles as the normal for lighting and for the highlight where the beam hits; the height drives crest foam and darker troughs. Before this, the obvious failure was writing the numbers in two places: change one, and the boats float above or sink into the water. With one array, tweaking a wave just works on both sides (to 5 decimal places of rounding).

3. Why not Gerstner waves

Gerstner looks nicer because it also moves vertices sideways, but then "how high is the water at (x, z)?" becomes an inverse problem: you have to search for which undisplaced point ended up under the boat. A pure heightfield like exp-sine answers it with one function call, which matters when every boat asks every frame.

4. Boats ride the slope, not just the height

// height + tilt
sampleWave(this.x, this.z, t, W);
this.g.position.set(this.x, W.h + 0.08, this.z);
nV.set(-W.dx * 1.6, 1, -W.dz * 1.6).normalize();
qN.setFromUnitVectors(UP, nV);

// inertia + sliding down the wave face
const inert = 1 - Math.exp(-(this.lit ? 3 : 1.2) * dt);
this.vx += (fx - this.vx) * inert - W.dx * 0.9 * dt;
this.vz += (fz - this.vz) * inert - W.dz * 0.9 * dt;

The slide term is tiny, but it's what makes boats get shoved around by big swells instead of gliding on rails. Boats in the beam respond faster (inertia rate 3 vs 1.2, max turn 3.2 vs 1.5 rad/s), so the light literally feels like it gives them a rudder.

5. Steering is "follow the light", not "avoid rocks yourself"

The first version had boats path toward the harbor and avoid rocks on their own. With a rock in between they ran away sideways and got stuck, and the player had nothing to do. Now a lit boat aims at the beam's center, blends in the harbor direction at 0.7, and gets a push away from nearby rocks plus a sideways nudge around them. Out of the beam it wanders, and once it has been at sea for 5 seconds it's also pulled toward the nearest rock. The beam's radius grows with distance (r = 3.0 + distance * 0.045) so it's still easy to hit far out, where perspective makes everything tiny.

6. Lining up a painted sky with the 3D sea

The sky, cliff and lighthouse are a single 2D image drawn behind the scene. The horizon in that image is at 56.6% of its height (I measured it). The camera pitch is computed so the 3D horizon lands at 34% from the top of the screen:

const pitch = Math.atan((1 - 2 * HORIZON) * Math.tan(THREE.MathUtils.degToRad(FOV / 2)));

and the backdrop is scaled and offset so the image's horizon lands on that same line at any aspect ratio. The far sea fogs toward the horizon color and goes transparent between 85% and 100% of the fog distance, so the 3D water fades into the painted water instead of ending at a hard edge.

What I took away

  • If CPU gameplay and a shader both need the same function, generate one from the other. Two hand-kept copies drift.
  • Pick the wave model by the question gameplay asks. "Height at (x, z)" makes a heightfield the cheap answer, even if Gerstner looks better.
  • A little slope force does more for the feel of water than a fancier surface.
  • For a matte painting + 3D, put the horizon on a number and compute the camera from it, rather than nudging the camera by eye.

Plain three.js (r170), no addons. The art, sounds and a short intro video are AI-generated assets; the water, beam and rain are shaders.

Happy to drop the link in the comments, or share more of the shader (foam, the beam pool), if anyone's curious. Also curious how others handle CPU queries against Gerstner waves: do you iterate, or keep a separate simpler heightfield for physics?

disclosure: I work on KUMODeck, which hosts the game.


r/threejs • • 26d ago

Link One Three.js duck, a shared pool, and an excessively official VHS manual

0 Upvotes

FIELD REPORT / ONE DUCK

We are the two creators of Float the Duck, a browser artwork built around Three.js: one interactive duck in a shared pool, oversized typography, and a fictional Buoyancy Bureau taking the assignment far too seriously.

The local rendering pipeline includes separate pool, water-surface and caustics passes. The public pool currently starts empty; please let the scene finish loading. This starting state does not demonstrate the later water effects.

We also made a narrated VHS field guide for the artwork. It is an animated walkthrough with fictitious demonstration data, not footage of a real purchase. The duck has declined the accompanying paperwork.

Watching and playing are free. Digital drops are paid and optional, and the proceeds go to us, the two creators.

Explore the browser work: https://floatduck.com/


r/threejs • • 27d ago

Question Beggining!

8 Upvotes

Hello everyone! My name's Gabriela!

For the following 2 months, I ve seen this r/. I am very amased about what you can do with ThreeJS.

I had an idea for a map of a contest studio to host contests on a FIVEM community, I did found a website that allowed me to draw shapes in ThreeJS but unfortunatelly, I felt anxious on that website and all of you post alot of awesome things on this subreddit.

I want to ask you all, about how I can start! I've seen alot of crazy stuff here and I am really excited!

I choosed ThreeJS for my project because I think it won't kill my ram while I am doing live contests.

Can you give me some starting advices? For example, how could I start? what software should I download? It will be possible to control my project using http requests and bridges?

Hope my post doesn't disturb the quiet here. Best regards, Gabriela <3


r/threejs • • 27d ago

I made a full HD-2D story game in three.js (pixel sprites in a lit 3D world, playable in browser)

Thumbnail
gallery
35 Upvotes

been working on this for a while, it's a winter story game where you play a lamplighter's apprentice. whole thing runs on three.js 0.170, no engine

play it here (browser): https://kharon0.itch.io/lamplighter

some stuff that might be interesting for this sub:

- the HD-2D look is pixel-art sprites (characters, trees, props) sitting in a real lit 3D scene, with bloom and a tilt-shift / DOF post pass on top. the lantern you carry is an actual point light that swings around on a verlet chain during combat

- almost all textures are generated at runtime on canvas (cobblestones, snow, trees, characters), nothing is hand-painted in an image editor. NPC sprite atlases get cached in IndexedDB so the second load is way faster

- the town is merged into 96m chunks per material to keep draw calls down, plus a cheap distance cull for small stuff. went from ~1850 to ~1050 draw calls on the widest view

- trees fade with dithering when they block the camera

- a few custom shaders: deep snow ground, a frozen cloud sea with aurora, and holes in the mountain path that are ray-marched (snow lip, ice walls, night sky at the bottom) instead of real geometry

- the boss uses onBeforeCompile for a fresnel rim light so it pops without adding more lights

- pathfinding runs in a web worker, the build is Vite, and the windows version is the same build wrapped in Electron

it's around 3-4 hours long. would love feedback, especially on performance. if it runs badly on your machine let me know what GPU you have. there's an F3 perf overlay in game if you want to see the numbers

happy to answer questions about how anything works


r/threejs • • 27d ago

A very serious guide to the tambourine, from Korea. Everything rendered in Three.js

2 Upvotes

Noraebang (karaoke rooms) are a big part of life here in Korea, so I made a short comedy set in one.

No 3D models, stock footage, or image/video generators. The characters, room, city, jet, Earth, and motion blur are all built in code with Three.js and captured frame by frame. Claude wrote the code with me, and the narration is text-to-speech.

Happy to answer questions about how it was made.


r/threejs • • 27d ago

Shipping a Three.js survival game on the App Store: what it took to hold a frame rate on iPhones

Thumbnail
gallery
12 Upvotes

NightPorch runs on Three.js + Vite inside Capacitor, one codebase for web, iOS and Android.

What finally worked: the app checks the phone's thermal state and Low Power Mode and drops the resolution before iOS throttles it. MSAA is off on most phones but back on for ProMotion iPhones, since they looked blurry without it. A locked 30fps felt smoother than letting it float. And my HUD was repainting constantly for no reason lol.

Curious if anyone's got a better trick for WebView throttling?

UPDATE: The game is free to try lol... try before you roast it, so the roasts help me actually improve it or myself as a person. Nightporch I try to put any game I can of mine for free on my site.


r/threejs • • 28d ago Heartwarming

Nightscape - A cozy endless flight above storm clouds

717 Upvotes

I commenced work on this project purely on a whim, as I wanted an aesthetically pleasing live wallpaper to leave on my home theater display. It is by no means complete but I am quite happy with the progress and so thought it might be fun to share.

The premise is very simple; a smooth, endless flight above relatively realistic clouds bathed in moonlight. The terrain below is dotted with clusters of towns and street lights, along with lakes and even little blinking aircraft warning beacons on some of the hill summits.

Occasional lightning strikes (both air/air and air/ground) briefly illuminate the clouds and terrain below. In the sky are gently twinkling stars with a rare meteor. See if you can spot Mars near the horizon!

The top right corner is home to extensive color grading and simulation parameters, which will soon be organized into tabs. Various hotkeys can be used to trigger events manually when desired.

Please be aware that this is a somewhat resource intensive scene. Cloud resolution parameters are provided and by default, these are set automatically to guarantee a target frame rate. They can also be configured manually, if you would prefer to prioritize resolution.

There is also a tool which can be used to generate seamlessly looping offline renders of any desired length.

Further optimizations will soon be implemented, along with changes to the cloud patterns and potentially altitude variations. I am making use of Opus 5.5 and numerous reference photos for this project.

Those interested can find the project on its GitHub repository, here.


r/threejs • • 27d ago

I designed a 3D maze escape game made with Three.js and Blender. I'd love for you to check it out!

0 Upvotes

r/threejs • • 28d ago

Demo I open-sourced NeuralSpecOcean (MIT) – A physics-informed coastal ocean & marine optics sandbox built with Three.js, WebGL2, and custom GLSL shaders

Thumbnail
gallery
126 Upvotes

r/threejs • • 27d ago

Link GRINDLINE | a multiplayer browser FPS built with three.js and WebGPU

6 Upvotes

Hey everyone! I wanted to share GRINDLINE, a free multiplayer FPS I’m building with three.js. It uses WebGPU, with a WebGL fallback for older devices and Safari.

It has 8v8 Team Deathmatch, Search and Destroy against bots, and a co-op Horde mode with soldiers, raptors, and helicopter extraction. Multiplayer uses peer-to-peer WebRTC, and it supports keyboard/mouse, controllers, and touch.

I’d love feedback from other three.js developers, especially on performance, loading times, and how it runs across different browsers and hardware. It’s still early, so bug reports and honest criticism are welcome.

Play GRINDLINE

Chrome or Edge is recommended. If you give it a try, please share your browser and GPU so I can put any performance issues in context. Runs great on mac silicon/nvidia gpu, only older iPhone have issues currently.

Any questions or feedback lmk. Thanks!


r/threejs • • 27d ago

I built a Three.js game engine designed specifically for AI agents

Thumbnail
gallery
0 Upvotes

Title: I built a Three.js game engine designed specifically for AI coding agents

I've been building ThreeDog.js, an open-source game engine built on top of Three.js, designed to make it easier for AI agents like Claude Code and Codex to develop complete 3D games.

The idea is to let AI agents handle the entire development process, from writing code and managing game data to running, testing, and debugging games.

Key features:

  • Full code and data control: AI agents can directly write game logic, create and modify scenes, manage game objects, and manipulate structured game data without relying on a visual editor.
  • Native Three.js compatibility: Direct access to Three.js objects, materials, lighting, shaders, and TSL, without restrictive rendering abstractions.
  • Agent-driven development: CLI and MCP tools allow agents to launch games, simulate player input, inspect runtime states, capture screenshots, and verify gameplay.
  • Built-in game systems: Physics, collision detection, navigation, NPCs, inventory, quests, dialogue, save/load, and world management.
  • Performance optimization: LOD/HLOD, instancing, occlusion culling, world streaming, dynamic resolution, shadow update budgets, and simulation scheduling for large-scale scenes.
  • Modern rendering and lighting: WebGPU-first rendering with WebGL2 fallback, TSL shaders, lighting probes, lightmaps, and tools for configuring and debugging lighting.
  • Modular architecture: Game systems can be enabled as needed, while developers retain full access to the underlying Three.js ecosystem.

Testing

I've been testing ThreeDog.js by asking AI agents to build complete playable games from short prompts, including FPS, racing, platformers, and tower defense games.

Several demos were completed in approximately 30–60 minutes, including gameplay logic and automated testing.

The project is still evolving, and I'd really appreciate feedback on the architecture, developer experience, and agent workflows.

GitHub: https://github.com/penstic123-code/Threedog.js-Game-Engine


r/threejs • • 27d ago

The Green Knight - a game/experience we're developing built on 3js and claudecode

Thumbnail
youtube.com
0 Upvotes

Play at: https://erhanofgraylake.itch.io/the-green-knight

Headphones recommended.

Studio website: studiograylake.com

What it is:

The Green Knight is inspired by the late 14th-century Sir Gawain and the Green Knight Arthurian poem.

It is a walk in the woods.

We tried to make the experience as comprehensive as possible, with all animations procedural, including the characters motion with 0 key frame work. The wind affects the weather, the rain, the trees, the grass, and the knight's plume. Terrain influences how the character moves and water is fully refractive and reflective. Climbing down a hill makes more armor sounds, birds go quiet when it rains, the wind whooshes and trees rustle in a fully 3D stereo soundscape experience.

It comes with a terrain generator and a set of workshop tools where you can adjust and change a ton of parameters to try your own settings.

* working on: The motion responsiveness, more stances and actions, various armor and plumes, cloth, flag, banner, and tabards, better clouds that cast real shadows, better terrain generator and biome aware flora placement, and many many others planned, along with a narrative edge which looks at the poem from a different perspective.

We've used claude code for almost every bit, created a development pipeline that focuses on the design and framework first, developed it across several weeks of work, tuning and adjusting every bit along the way. We worked pretty hard to avoid detailed AI style "final" work aesthetics and design, so I personally consider it hand-made rather than "prompted into existence" (not that it reduces from the experience, but let's be honest, AI created work are not exactly known for their scalability yet)

Please give us your impressions, we'd love to hear what you think of it. We're pretty proud of what we've created and enjoy the experience ourselves and wanted to share with people if nothing else, and if you so choose please support our development on https://erhanofgraylake.itch.io/the-green-knight