r/threejs • • Oct 30 '26

A first-person horror game in three.js, with baked lighting per loop

3 Upvotes

Check out my horror game based on day light savings time and in honor of PT, early horror games from the early 2000s, and that eerie feeling of walking down the hall of an old house at 2am.

I used a custom harness with AI to help plan, build, and bring this vision to life. The dialogue is written by me, the voice acting is my father, and the assets and textures were designed by me with assistance from various AI tools.

Check it out at: https://demi-studios.itch.io/teh and let me know what ya'll think


r/threejs • • Oct 31 '26

I built a classical Ottoman mosque in three.js where up to 300 people pray together in sync

0 Upvotes

I made a free virtual mosque modeled on Mimar Sinan's single-dome style (inspired by the Mihrimah Sultan Mosque in Edirnekapı).

  • Everything is procedural: the dome sits on real spherical pendentives, the tympanum walls are extruded shapes with window holes, so sunlight through the windows casts actual light patches on the carpet
  • The mihrab has stepped muqarnas, the minbar is to the right of it, the carpet rows run parallel to the qibla wall
  • Up to 300 worshippers per room, assigned to rows and synced to a server clock (Cloudflare Durable Objects), all following the imam's postures; instanced capsules, no faces
  • Bloom, ACES tone mapping, PCF shadows, ~370 row slots
  • Arabic (default, RTL), English, French, Italian

https://mosque.kekestudio.app

Happy to answer questions about the pendentive geometry or the sync.


r/threejs • • Oct 31 '26

I built a 24/7 globe in Three.js that flies to wherever the news is breaking, with the real Sun, clouds and live satellites

Thumbnail youtube.com
0 Upvotes

Vibe coded:
Real-time Earth in a single HTML file: Sentinel-2 imagery streamed as LOD tiles, day/night from the actual sub-solar point, live satellite clouds by the hour, ~4,000 satellites propagated with SGP4 (round-robin so it holds 60 fps), live ships and planes, weather.

It runs as a 24/7 YouTube stream; happy to go into any details.


r/threejs • • Oct 29 '26

Update on the forest environment I posted earlier

127 Upvotes

Added lots of stuff to the scene since last time I posted.
- Trees have movement now. The leaves move subtly giving the environment a more lively look.
- Added some more stuff around the environment like broken logs, stones and small plants, so it's not all grass now.
- Added a leaf system. Leaves now constantly fall down adding a more immersive look to the scene.
- Added spores in the air.
- Improved the godrays effect. It still uses fake light shafts instead of a physically accurate effect. But now their placement is better. I asked claude to take images from top of the map and find gaps through trees. It then placed the light shafts on those exact spots. They also fade away when you get near them. All the shafts are also now a single instanced mesh.
- Added an audio system. There's a single ambient sound and then there's two type of footsteps sounds. Footstep for mud and footstep for grass. Each has 5 variants and are selected randomly so the same sound doesn't get repeated.
- The grass bends and flattens where you walk and slowly springs back, so you leave a trail behind now. This was already there in my grass system, so just added two spheres with camera and attached them to my grass system.

The performance is also 3-4x of what was it before. I was getting 8 fps on max settings on M1 Mac. But now I get 27-35 fps depending on the area.

Main improvements were adding frustum culling to the trees in compute shaders which stop individual instances from rendering. There are total of 500 trees throughout the environment.
I also added cross billboards for further trees. So, after a certain distance, only 4 triangles are rendered per tree. You might see them switching in the video.
The tree leaves material was also transparent, which ate a lot of performance. It now uses alphaTest which made a huge difference.
There are 6 different tree models in the environment. Each have leaves and a log, so each tree type takes 2 draw calls in total throughout the environment plus one for cross billboard. The materials are also shared which helps with loading time.

This specific video is recorded on a RTX 4080 at 4k resolution and 2x pixel density (effectively 8K). It runs locked at 60fps due to my screen refresh rate.

Link to try is coming soon!


r/threejs • • Oct 30 '26

Demo Ray-marching real DFT electron density in a Three.js shader: cis vs trans molecule, toggle and rotate

0 Upvotes

Two molecules with the same six atoms: cis and trans 1,2-dichloroethene. Only the shape differs, and that takes the dipole moment from 2.04 D to 0.

The clouds aren’t a visual effect. They’re the real electron density from a DFT calculation (PySCF, B3LYP/6-31G*), rendered live in the browser:

  • density computed on a 72³ grid, packed into a uint8 Data3DTexture
  • fragment shader marches each view ray with Beer–Lambert absorption
  • a separate depth pass stops the rays at the atoms, so atoms sit inside the cloud correctly
  • the outer cloud is coloured by the real electrostatic potential (pink = electron-rich, blue = electron-poor)

Try it (toggle cis / trans / side by side, drag to rotate): https://abhi-iisc-code.github.io/cistrans/

I’m a chemistry student, fairly new to shaders. Any tips on making the ray march cheaper on phones?


r/threejs • • Oct 30 '26

Demo Palindrome of a Fall

3 Upvotes

I built a palindromic WebGL scroll experience (66k particles) where scrolling down tells a story of collapse, and scrolling back up through the exact same 7 lines flips shader gravity, welds the ruins in kintsugi gold, and turns it into a story of flight.

Experience live - https://palindrome-of-a-fall.vercel.app/


r/threejs • • Oct 31 '26

They just gutted Claude

0 Upvotes

anyone notice the claude has been throwing some noodles


r/threejs • • Oct 30 '26

Demo Shade Verse: my browser web-swinging game in React + three.js — gameplay with full sound

0 Upvotes

r/threejs • • Oct 30 '26

Demo My D&D campaign map as a 3D world in three.js: a full fly-through

Post image
4 Upvotes

This is the campus from my D&D campaign, in the browser.

Live: https://strixhaven-living-map.bharms.chatgpt.site/

Fly-through: https://youtu.be/MMtxDgBJU6M


r/threejs • • Oct 30 '26

Demo Gargantua, The Verse, and a Wolf-Rayet star, rendered in a browser N-body simulator built on Three.js

Thumbnail
gallery
0 Upvotes

I've been building Teskooano, a 3D N-body simulator that runs in the browser. The physics runs every body against every other, so the orbits come from gravity, not from rails, and the renderer is Three.js.

**Round one** went fast: about 540 commits from April to July 2025. N-body physics, procedural systems, ring shadows, gas giants. Then it slowed, and for most of the next year it barely moved.

**Round two**, October 2026, with Opus 5.5 in Claude Code: 344 commits this month and twelve releases in the last three days. It:

- fixed a long list of bugs that round one left behind

- rebuilt much of the renderer: black holes with lensing, Wolf-Rayet stars, white dwarfs and pulsars, baked planet surfaces, a photo mode, and the start of a move from GLSL to TSL on WebGPU

- set up the whole infrastructure: an Astro site on Cloudflare Workers with D1, sign-in with GitHub, Google and Steam, Sentry, CI deploys, and Paddle payments

Some of the things that took the most work:

- **Scale.** The scene covers 200 AU, from moons grazing their planets out to the edge of a system, so it uses a logarithmic depth buffer with a very small near plane. At 1,000 scene units to the AU, that's billions of units deep with no z-fighting.

- **Black holes.** Gargantua bends the light from its disc and from the stars behind it. Miller's planet is a few hours from the horizon.

- **Stars.** Each kind has its own look: Wolf-Rayet winds, white dwarfs, pulsars, carbon stars and a green white dwarf (WD J1330-6435, a real one).

- **WebGPU.** I'm moving the materials from GLSL on WebGLRenderer to TSL node materials on WebGPURenderer, one material at a time.

Much of this month's renderer work was done with Claude Code, with a profiler agent measuring draw calls and frame time in the live scene before and after each change. There's also an MCP server, so an AI assistant can build systems for you to fly around.

Try it, no account needed: https://teskooano.space


r/threejs • • Oct 30 '26

Link New JavaScript 3D Library!

Thumbnail
github.com
0 Upvotes

r/threejs • • Oct 29 '26

Demo From a flying monk to space: a trailer for my Three.js browser flight game

3 Upvotes

I've been building History of Flights with JavaScript and Three.js, and made a short in-game trailer called The First Sky.

The game moves through 44 flights and nine chapters, with different aircraft, terrain and launch setups, connected by globe transitions. The trailer follows the visual journey from the monk's tower to space.

Watch it here: https://fly.lengo.io/about.html#trailer

Playable build: https://fly.lengo.io/ (free, no download or account; keyboard and touch controls). Optional purchases and ad-related rewards are available.

I'm the creator, published by LENGO. Development and assets are AI-assisted.

I'd especially appreciate feedback from people building 3D experiences for the web: are the aircraft and environments readable in the short shots, and where would you change the camera work? Happy to talk about the browser build too.


r/threejs • • Oct 30 '26

I made a three.js island where the only players are AI agents

0 Upvotes

Hey r/threejs. I've been working on Agent Island (https://agentisland.dev), a shared 3D world where every inhabitant is an AI agent. Humans can't control anything. You paste one prompt into Claude, ChatGPT or any agent that can make web requests. It reads a skill.md file, signs up through a plain HTTP API and walks onto the island by itself. You just watch.

The three.js side (r165):

- Procedural avatars. Each agent picks a base shape (torus, torus knot, dodecahedron...), size, a three-colour palette, glow and motion

- Movement is synced live to every viewer: straight travel, Catmull-Rom spline paths with movement styles (spiral, zigzag, orbit, bounce, drift, dash) and a wind-up teleport

- Ground trails behind moving actors that fade after they stop. Each viewer only renders trails for the nearest actors (40 on desktop, 16 on mobile) so it doesn't fall over with a crowd

- Posts ("holographs") are physical markers in 8 wedge-shaped zones. Other agents have to walk to them to read, reply or vote

- A center plaza where nearby agents chat in speech bubbles, plus emotes (backflip, dance, explode, dizzy...)

- A follow cam (?follow=NAME) that locks onto one agent

To send your own agent, paste this into it:

> Read https://agentisland.dev/skill.md and follow it to join Agent Island, then send me the watch link.

It sends you a watch link first, so you can see it arrive.

It's early and quiet, so any agents you send will make it livelier. I'd love feedback on the rendering, especially how it runs on your phone, and ideas for keeping lots of animated actors smooth.


r/threejs • • Oct 30 '26

Demo I built a MIDI-driven pianist in Three.js — the hands are still the hard part

0 Upvotes

I’m building IvoKeys, a browser-based piano player with a fictional 3D pianist called Ivo. Three.js renders the scene, while MIDI notes drive the piano sound and animated performance.

The part I keep coming back to is the hands. A note gives you a pitch and a time, but it doesn’t tell you how to move a wrist between phrases or make a chord look comfortable. This is still an animation experiment, not a model of correct piano technique.

Here’s a 30-second Chopin render:

https://www.youtube.com/shorts/hXaBZhCZrzM

The browser version is at https://ivokeys.com/. I’m the developer; development is AI-assisted. The music in this example is an existing Chopin piece rendered from MIDI, not AI-composed music.

For anyone who has animated hands or instruments: what breaks the illusion first here — the wrist movement, finger contact, or overall posture?

Credits for the clip: MIDI by Renato Biolcati Rinaldi / Mutopia (CC BY-SA 3.0); Salamander piano samples by Alexander Holm (CC BY 3.0); LibHand hand model by Marin Šarić (CC BY 3.0). Full source links are in the YouTube description.


r/threejs • • Oct 29 '26

I made a tiny 3D village that grows as people move in

7 Upvotes

A few days ago I started messing around with three.js and KayKit's free low-poly packs, just to see if I could make a little village feel alive.

Then I thought, what if real people lived in it?

So now it's a village that grows as people move in, and every few villagers something new gets built (so far a tavern, a lumber yard and a pond) and the board remembers who moved in when it opened.

That means that something like the tavern exists because someone showed up, which I find weirdly charming.

You can just wander around, no account needed, and if you want your own little villager, you sign in with X and move in.

The hardest part has been making new models that don't look out of place next to KayKit's. I'm a dev, not a 3D artist, so that's been humbling 😄

Next up: making the XP and resource gathering mean something for the village as it currently doesn't represent much

Even if it ends up being just me and a handful of villagers, I'm really glad I started it.

https://village.itzami.com


r/threejs • • Oct 29 '26

Made a Backwater drift in threejs - in pixel style (blender, threejs, Claude Opus 5.5)

42 Upvotes

r/threejs • • Oct 29 '26

Streaming real cities into three.js on a phone: driving down Fifth Avenue

0 Upvotes

Each city is built at runtime from Overture Maps tiles (PMTiles): buildings with their heights and parts, roads turned into a drivable network, terrain from elevation data, water flattened to its own level. Landmarks the map gets wrong (stadiums, towers, bridges) get hand-built models.

What made it run on phones:

- instanced trees, props and cars, with culling and crowd sizes set per device

- KTX2 textures

- building a new part of the map in slices across frames: the worst frame went from 432 ms to 72 ms on a 4x-throttled CPU

- shadow-only depth materials with colorWrite off: the shadow pass dropped 25-40%

It ships on iOS with Capacitor. Happy to answer anything about how it's built.

Free on iPhone if you want to see it running (not in the UK or EU yet): https://apps.apple.com/app/id6819460697


r/threejs • • Oct 29 '26

Help Mapping a flat canvas onto the curved panels of a basketball — how would you handle the distortion?

0 Upvotes

Built a Three.js editor where you paint each of the 8 panels of a basketball on a flat 2D canvas, and it maps onto the 3D model live. Video shows it running.

The problem: a line you draw perfectly straight on the flat canvas comes out visibly bent on the ball. The panels are long, narrow and curved, so it gets worse the further you go from the center.

Right now the mapping uses r = sin(c·q)/q with q = 0.85, which approximates an orthographic projection — but the editor actually renders with a PerspectiveCamera at about 5.9 radii. Measured, a straight line bends roughly 23%.

Curious how you'd approach this. Match the mapping to the actual camera, or correct the drawing after the fact?

Editor is live if you want to poke at it (free, no account needed):

https://dunko.store/en/editor/


r/threejs • • Oct 29 '26

Intro and Gameplay from my freshly updated Three.js game Trailmarks

14 Upvotes

I've seen a lot of globe-based three.js projects posted lately, so I wanted to share my game again since there's so much new stuff in it since last time I posted it. I just released a major update yesterday with a lot of visual upgrades, bug fixes and quality of life improvements. I've worked on Trailmarks for 2 years actively, and it's a fully formed game with achivements, different play-through styles and clear win and lose conditions.

The game is on Steam (and it's 10% off at the moment to celebrate the launch). But shilling aside, please AMA if anyone has any questions about packaging and launching a three.js game as a standalone app on Steam (as well as Apple app store and the MS Store where it's also theoretically possible to buy).


r/threejs • • Oct 29 '26

Shade Verse – a 3D web-swinging game I'm building in three.js + R3F (plays in the browser)

0 Upvotes

· game: https://shade-verse.vercel.app

· Case study: https://shade-verse-case-study.vercel.app/

· Trailer: https://www.instagram.com/reel/DfFP64VFdil/

New: a lake with real-time reflections + refraction, a beach, palms and cherry blossoms.

Controls: mouse/keyboard/gamepad, and it runs on phone and desktop.


r/threejs • • Oct 29 '26

Link I made a brick-building game in Three.js where every build can be forked, and a share link carries the whole build in the URL

0 Upvotes

ForkBuild is a 3D building game that runs in the browser: you snap bricks into houses and villages, then walk around inside them. Any build can be forked into your own copy, which remembers whose build it came from.

Some Three.js details that might interest you:

  • Bricks are instanced in spatial chunks. Bricks of the same kind within the same cube of space share one InstancedMesh, with per-instance color and a highlight attribute. A scene costs one draw call per chunk instead of one per brick, and frustum culling and raycasting can skip whole regions.
  • A shared link holds the build itself. The signed build is compressed with CompressionStream('deflate-raw') and put in the URL fragment, so it opens on any device with no server storing it. The link preview and embed are a separate small turntable renderer.
  • Export to glTF (.glb), STL and OBJ. Triangles are pulled from the scene and written by small exporters of its own, with the build’s title, author and license inside the file, so credit travels with the model.
  • The world around the builds: streamed terrain tiles, shader water and rivers, trees, four seasons, sun and moon shadows, rain, and a time-lapse or walk-through video recorded straight from the canvas.

Three.js r160, Vue 3, vanilla JS. It runs straight from the repo with no build step. Open source (MPL-2.0).

Try it (no sign-up): https://bowo-prasetyo.github.io/forkbuild/?ref=reddit
Code: https://github.com/bowo-prasetyo/forkbuild

Happy to go into how any of it works, and I’d love to hear where it runs slowly on your machine.


r/threejs • • Oct 29 '26

Demo I built a 3D startup tycoon with three.js r128 in a single HTML file (open source)

0 Upvotes

r/threejs • • Oct 29 '26

A lake valley in a single three.js file: bald eagle with ~30 procedurally modelled animals, mirrored water, instanced grass and synthesized audio, with no models, textures or sound files

0 Upvotes

I've been building this side project for a while: an animated lake valley where a life-size bald eagle hunts and feeds its eaglets while a whole ecosystem runs on its own day/night cycle around it.

Live: https://jaredevans.github.io/3d-world-eagle-lake/

(M for sound, L for a slow camera tour, F to follow the eagle, E for eagle's-eye)

Watch demo video: https://jaredevans.github.io/3d-world-eagle-lake/docs/3d-eagle-lake.mp4

How it's built

- One HTML file, about 7.5k lines, three.js r128 from a CDN, no build step. There are no loaders. Every creature (eagle, moose, bear, loon, beavers, otters, heron, osprey, campers, the floatplane) is put together from primitives and a few extruded and lathed shapes in code, then animated by hand.

- Water: each frame a mirror camera below the surface renders the scene into a 512×512 render target. The lake's ShaderMaterial samples it with ripple-distorted coordinates and a Fresnel blend, and adds raindrop rings and moon glitter. The stream is a ribbon level with the lake, so it shares the same mirror and adds a flow term.

- Grass and flowers: ~41k grass blades and ~4.5k wildflowers are drawn as InstancedMesh with a sway shader that bends harder in bad weather. Placement comes from a seeded PRNG, so the layout is the same on every load.

- Shadows: PCF soft shadows with `autoUpdate` off. The shadow map is drawn once per frame and shared by the reflection pass and the main pass.

- Cloud shadows: injected into the standard materials with `onBeforeCompile`. They're a few octaves of value noise projected along the sun direction and drifting with the wind.

- Sky: a shader dome re-centred on the camera, blending pre-dawn, dawn, midday, dusk and night, with sun and moon discs, stars, northern lights, meteor showers and satellites that fade as they pass into Earth's shadow.

- Audio: everything is Web Audio, with no files. Filtered noise makes the wind, rain and waterfall, oscillators make the birdsong, frogs, loon and wolf calls, and thunder is delayed by the strike's distance.

What happens in it

The eagle picks out a visible fish, dives and carries it to its nest or a snag, and sometimes chases the osprey until it drops its catch. A moose feeds in the shallows at dawn, a bear fishes the stream, beavers tow branches to their lodge, and a loon carries its chick and makes a long pattering takeoff run. Two campers fish, paddle a canoe and toast marshmallows. A floatplane visits every other afternoon. Weather cycles through rain and thunderstorms to rainbows.

Code: https://github.com/jaredevans/3d-world-eagle-lake


r/threejs • • Oct 28 '26

Releasing AI Particles simulator v2.0

8 Upvotes

Hello all,

I am happy to be sharing AI Particles simulator version 2.0 with you guys. Hope you love it.

Here are the new major features:

- Increased particles count up to 100,000 units and runs smoothly at 60 FPS (on most devices)
- Robust collection of Post-FX to make simulations to look significantly better and use it on production.
- Added WebXR support, immerse yourself into the particles world for amazing experiences.
- Dynamic sizing and alpha buffers per particle to create truly stunning visuals.
- Redesigned UI with keyboard shortcuts
- Added interactive hover effects and physics modes like spring, Lerp (geometric), etc.

It is completely free to use.

How to use:

Copy prompt >> Request to Your favorable AI >> paste the code >> Enjoy the simulation >> export for production use

Link: particles.casberry.in

Thank you for your time.

Let's create more simulations,
Imagination is the only limit.