Inside the
Abyssal Garden

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

Abyssal Garden's kelp forest, stone whale tail and manta ray
Scroll
Published2026-11-22
CategoryTech Teardown · 3D Interactive
Reading TimeAbout 12 min

It Started With a Link

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 First

Abyssal Garden underwater sceneDive 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.

A Few Terms First

Before the teardown, here are the terms that come up, in plain language. Read them once and the rest will make sense.

Mesh
The "skin" of a 3D object, built from lots of small triangles — like covering a ball with triangular paper scraps. Graphics cards can only draw triangles, so cliffs, ships and fish all end up as meshes.
Grid and voxels
Space cut into little cubes, like the world in Minecraft; each cube is a voxel. Not to be confused with a mesh: the grid stores data, the mesh is the surface that gets drawn.
Density field
One number stored in every voxel saying "rock or water here". With it, the computer knows the shape of the whole seabed.
GPU (graphics card)
The chip that draws pictures. Think of a factory with thousands of workers who each do something simple, all at the same time — perfect for millions of points at once.
Shader
A small program that runs on the GPU. Some decide where each point goes on screen, others decide the colour of each pixel.
Compute shader
A shader that doesn't draw anything — it just crunches numbers. Abyssal Garden uses one to compute 21 million terrain cells in seconds.
WebGPU, WebGL and WGSL
The "windows" browsers give web pages onto the GPU. WebGL is older and runs almost everywhere; WebGPU is newer and faster but needs a recent browser. WGSL is the language WebGPU shaders are written in.
Game engine, Three.js
Ready-made toolkits that handle lighting, materials and cameras for you. Convenient, but they bring along plenty of features you never use.
Noise (fbm)
"Orderly randomness". Pure random numbers look like TV static; noise is smooth random rolling. Stack coarse, medium and fine layers (fbm) and you get mountains from afar and rock texture up close.
Surface Nets
A way to turn "rock and water in a grid" into a cliff mesh: put a point in every cube where rock meets water, then connect neighbouring points.
Instancing
Drawing one shape many times. Like a rubber stamp: carve it once and stamp it two million times, instead of carving two million stamps.
Draw call
One command from the CPU telling the GPU "draw this batch". Every call has a fixed cost, so fewer is faster.
Culling
Not drawing what you can't see: anything behind you or too far away is skipped.
Shadow map
A picture taken from the sun's point of view of "what is closest to the sun". When drawing the scene, anything hidden behind something else is in shadow.
HDR and Bloom
HDR can store brightness "brighter than white", like sunlight. Bloom lets those very bright areas glow outwards, like a camera catching a strong light.
Caustics and light shafts
Caustics are the wobbling net of light that sunlight makes on the floor after passing through a rippling surface, like the bottom of a pool. Light shafts are the visible beams sunlight makes through particles in the water.
Anti-aliasing
Smoothing the staircase look off diagonal edges.
FPS
Frames drawn per second. 60 fps feels smooth; under 30 starts to feel choppy.
Garbage collection (GC)
JavaScript periodically reclaims memory that is no longer used. The program pauses for a moment while it does, and the picture stutters.
Bundling and minifying
Joining many source files into one and stripping spaces, comments and long names so the file gets smaller.

See It in Motion

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.

Mesh: drag the slider from 20 to 5,120 triangles and watch a gem-like solid turn into a sphere. Drag to rotate; hide the edges to see how smooth it really is.

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.

Grid → density field → Surface Nets: exactly how Abyssal Garden builds its terrain, shrunk from 3D to 2D. Press 1, 2 and 3 to walk through each step.

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.

Noise (fbm): this is how Abyssal Garden gets its bumpy cliffs. Drag the slider to stack ever-finer layers of variation.

So What Does It Actually Use?

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.

No Game Engine, Raw WebGPU

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.

Terrain: Rock or Water, Cell by Cell

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.

Clearing Out Floating Specks

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.

Collision: Distances Only Near the Rock

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.

Two Million Kelp Leaves in One Go

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.

The Steps Behind Every Frame

Every frame works like setting up lights before a photo and retouching afterwards:

  1. Water texture: caustics (the wobbling light net on a pool floor) and surface ripples, then shrunk into several smaller copies.
  2. Main scene: terrain, rocks, kelp and fish, drawn in HDR with 4× anti-aliasing.
  3. Light shafts: at half resolution, 34 samples along every view ray against the shadow map give volumetric sunlight.
  4. Shaft blur: a depth-aware 3 × 3 blur smooths out the sampling grain.
  5. Bloom: shrunk down six levels and added back up for a soft glow around bright areas.
  6. Composite: depth fog (bluer in the distance, cyan near the surface), tone mapping and output.

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.

Bake Whatever Can Be Baked

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.

Self-tuning: Resolution First, Then Draw Distance

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.

No Garbage, Ever

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.

Even the Sound Is Synthesized

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.

Squeezing It Into 96 KB

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.

Same Ideas, New World: Circuit Ant

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.

Circuit Ant: an ant's-eye view over the whole circuit boardBecome 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.)

Standing between two rows of gold-plated header pins, like a temple colonnade
Two rows of gold-plated header pins: a 20-metre colonnade for an ant
A decapped chip with gold bond wires arching from the silicon die to the ceramic package
The decapped chip: an iridescent silicon die and 88 gold bond wires, 25 µm each

What I Learned, What I Changed

Abyssal GardenCircuit Ant
World generationGPU density field, Surface Nets cliffsTraces routed like a PCB engineer would: parallel buses, 45° turns, vias at obstacles
Mass objectsTwo million kelp leaves (instancing)3,000+ parts, 6,000 trace segments (instancing)
ImmersionLight shafts, caustics, deep-blue fogMacro depth of field, dust, antennae
Collision3D distance bricks, swim through arches2D height map, climb walls
PerformanceShadows baked once, quality tuned by GPU timeShadows baked once, quality tuned by FPS
Tech choiceRaw WebGPU, no engineThree.js + WebGL for wider device support

What Does This Mean for a Brand Website?

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.

FAQ

Why won't the ocean load and say it needs WebGPU?

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.

Can 96 KB really hold a whole world?

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.

Is Circuit Ant a modified version of Abyssal Garden?

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.

Can you build an experience like this for my product?

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

Want Customers to Walk Inside Your Product?

Machine interiors, product teardowns, space tours — we can turn them into an interactive experience people explore for themselves.

Contact Us

Credits

Abyssal 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.