How does a 96 KB web page hold an entire ocean? I dove in, read the source code, and mapped out every technique it uses.
2026
One day I opened a web page called Abyssal Garden. A few seconds later I was under the sea: sunbeams slanting down through the surface, kelp swaying in the current, a sunken ship in the distance and manta rays gliding overhead. I could swim anywhere with the keyboard.
Then I noticed one line in its README: the whole world is 96 KB. A single phone photo is around 3 MB — this file is a thirtieth of that. No images, no 3D models, no sound files, and no game engine.
My first thought was: how is that even possible? So I decided to take it apart. Before we get to how it works, dive in and see it for yourself.
Dive in ↗Opens the author's own site in a new tab and needs desktop Chrome or Edge with WebGPU. Wait a few seconds for the world to generate and press "Dive in". Mouse to look, WASD to swim, E / Q for up and down, hold Shift to go faster, keys 1–6 jump between viewpoints.
Before the teardown, here are the terms that come up, in plain language. Read them once and the rest will make sense.
Words only go so far — try it yourself. These three small demos cover the three core ideas of the article, and all of them are interactive.
Every grid point stores one number: brown dots are rock (positive), blue dots are water (negative). This is the density field. Click to add rock, Shift-click or right-click to dig.
Each layer is twice as detailed and half as tall as the one before. One layer gives gentle hills; stack more and you get rock texture. The thin coloured lines below are the individual layers.
The author published the source on GitHub — about 2,500 readable lines across seven files. I read them one by one and ended up with one sentence: what it sends you isn't the ocean, it's a recipe for making the ocean.
A typical 3D game is like moving house: artists build models and textures and ship you gigabytes of them. Abyssal Garden is like mailing a recipe — once your computer receives it, the GPU follows the steps and builds the whole world on the spot. Here is each step, in the order it runs.
Most 3D on the web uses a toolkit like Three.js. Abyssal Garden does everything itself: it talks to the browser's WebGPU interface directly, and every program that runs on the GPU is hand-written in WGSL. In effect it builds a tiny engine that serves only this ocean, with no unused features — the first reason it is so small.
Picture the sea cut into Minecraft-style cubes, each storing a single number: positive for rock, negative for water. That is a density field. Abyssal Garden's grid is 512 × 80 × 512 cells at 0.75 m each, covering a 384 × 60 × 384 m stretch of sea — about 21 million cells.
All of them are computed in parallel by a compute shader. The formula combines hand-designed rock masses, arches, tunnels and clearings with several layers of noise (fbm) for natural bumps in the cliffs.
Once it knows where the rock is, Surface Nets finds the boundary between rock and water: it places a point in every cube that crosses it and connects neighbours into triangles, giving the cliff mesh. The stone whale tail uses the same trick — tapered capsules described in maths, then turned into a mesh.
Noise sometimes leaves a tiny isolated lump of "rock" floating mid-water. The fix is intuitive: starting from the seabed, mark all rock connected to the ground and keep spreading outwards; anything never reached has nothing holding it up and turns back into water. The deliberate floating boulders are placed separately and aren't affected.
You glide along cliffs instead of passing through them thanks to a table of "how far to the nearest rock". Storing that for 21 million cells would be wasteful, so space is split into 4 × 4 × 4 bricks: all-water or all-rock bricks store a single flag, only bricks touching a cliff keep detail, and only within reach of the camera — about 2 MB in total. Kelp, coral and the ship deliberately have no collision so you can swim through them.
The scene holds around two million kelp leaves, tens of thousands of rocks and thousands of sponges, corals and fish. They aren't drawn two million times; instancing tells the GPU "stamp this leaf shape at these two million positions". Each leaf is packed into 36 bytes.
The world is also split into a 16 × 16 grid of 24 m cells. Each frame only draws cells that are in view and close enough, nearest first so hidden things are skipped early. Leaf data is pre-sorted by cell, so neighbouring cells merge into a single draw call.
Every frame works like setting up lights before a photo and retouching afterwards:
Fog also hides the edge of the world: terrain is only drawn to about 240 m, and beyond that the screen is filled with "the colour water has at that distance", so you never see where the world ends.
The sun never moves, so the 4096 × 4096 shadow map is rendered once at load and reused; the rock detail texture is baked up front too. The roughly 300 MB of JavaScript scratch data used to generate the world is released as soon as it has been handed to the GPU.
GPU timestamps measure how long each frame really takes. When it's too slow, resolution drops in small steps, then the draw distance for plants and rocks shrinks, aiming for a steady 60 fps. The scene is already running, blurred, behind the start menu, so most of this tuning is done before you press "Dive in", and the result is remembered for next time.
There are also Low, Medium and High detail levels: Medium keeps half the leaves, Low keeps a quarter and turns off anti-aliasing. If loading crashes the tab, the next visit automatically starts one level lower.
JavaScript periodically "takes out the trash" (garbage collection), and the picture stutters when it does. The author's rule: allocate no new memory inside the frame loop. Every value that changes per frame lives in fixed, pre-allocated arrays, so garbage collection practically never triggers while you play.
There are no sound files. The low rumble, surface wash, water rush that follows your speed, bubbles, chimes and distant whale calls are all synthesized live from oscillators and noise with the Web Audio API, driven by a 10 Hz timer rather than the frame loop.
The seven source files are joined in order, comments and whitespace are stripped from the shader strings, esbuild minifies the JavaScript, and everything is dropped into one HTML template. The result is that single 96 KB file that even works offline.
Afterwards I wondered where else the same ideas could work. Many of our clients are manufacturers — machines, circuits and chips are all around us, yet nobody has ever walked inside one. So I decided to shrink myself into an ant and drop myself onto a circuit board.
Your eyes are 0.9 mm above the board. At this scale an electrolytic capacitor is a 14-metre tower, the gap between heatsink fins is a 25-metre canyon, and pulses of signal flow along the copper traces. Walk into a wall and you climb it; double-tap Space and you fly.
Become an ant ↗Opens in a new tab and runs in most browsers: mouse to look, WASD to walk, keep pressing W at a wall to climb, double-tap Space to fly. (The in-game interface is in Traditional Chinese.)


| Abyssal Garden | Circuit Ant | |
|---|---|---|
| World generation | GPU density field, Surface Nets cliffs | Traces routed like a PCB engineer would: parallel buses, 45° turns, vias at obstacles |
| Mass objects | Two million kelp leaves (instancing) | 3,000+ parts, 6,000 trace segments (instancing) |
| Immersion | Light shafts, caustics, deep-blue fog | Macro depth of field, dust, antennae |
| Collision | 3D distance bricks, swim through arches | 2D height map, climb walls |
| Performance | Shadows baked once, quality tuned by GPU time | Shadows baked once, quality tuned by FPS |
| Tech choice | Raw WebGPU, no engine | Three.js + WebGL for wider device support |
The biggest lesson from Abyssal Garden wasn't a single technique but an idea: instead of shipping the finished product, ship the recipe and let the visitor's computer build the world.
A website doesn't have to be something you only look at — it can be somewhere you explore. Manufacturers can let customers walk inside their machines, developers can let buyers stroll through spaces that aren't built yet, and brands can turn a product story into a journey.
Abyssal Garden draws with WebGPU directly, which needs a recent desktop Chrome or Edge. If your browser doesn't support it, try Circuit Ant further down the page — it uses WebGL, which runs in most browsers.
What it holds isn't the world itself but the program that generates it. Terrain, kelp, the shipwreck, fish and sound are all computed by your GPU and browser in the few seconds after the page opens, so the file needs no images, models or sound files.
No. After understanding how Abyssal Garden works, we wrote a new piece with a different theme from scratch; none of its code is reused. Abyssal Garden is written directly in WebGPU, while Circuit Ant is built on Three.js and WebGL so it opens on more devices.
Yes. Machine interiors, product teardowns and site or space tours are all a great fit. Letting customers walk through a product themselves is far more memorable than a single product shot — get in touch and let's talk.
CONTACT US
Machine interiors, product teardowns, space tours — we can turn them into an interactive experience people explore for themselves.
Contact UsAbyssal Garden by Maksymilian Dendura, open-sourced under the MIT License. Every ocean link in this article points to the author's own site, and the screenshot comes from the project README. Thank you for sharing such a beautiful piece of work together with its source code.