Spaces:
Running
Download README.md from Mike0021/aquatic-world: direct link, hf CLI and curl.
- Browser
- Download file 3.38 kB
-
https://huggingface.co/spaces/Mike0021/aquatic-world/resolve/main/README.md
- Command line
-
hf download hf://spaces/Mike0021/aquatic-world/README.md
-
curl -L -o README.md https://huggingface.co/spaces/Mike0021/aquatic-world/resolve/main/README.md
title: Aquatic World
emoji: π
colorFrom: indigo
colorTo: blue
sdk: static
pinned: false
Aquatic World
A dense, real-time, procedurally generated ocean β rendered from scratch in WebGL2 with no engine, no assets and no runtime dependencies. The whole world is one self-contained HTML file: open it and it runs.
Everything you see is computed. There are no textures, no meshes and no model files. Terrain, waves, foam, clouds, coral, fish, kelp, jellyfish, whales and even the sound are generated by code at load time from a single seed.
The water
The water is the point. It is not a shaded plane:
- Ray-marched volume. The surface is a displaced height field intersected analytically and refined by Newton iteration, then the ray continues into the water and marches the medium β per-channel absorption, in-scattering and light shafts, terminated against the real scene depth so creatures and seabed are correctly occluded by the water in front of them.
- Caustics from the Jacobian. Sunlight focuses through the wave field, so intensity goes as 1/|det J| of the surface mapping. Sharp bright filaments and dark cells fall out of that for free, and they animate in step with the waves because they are the waves.
- Snell's window. Look up from under the surface and you get the bright refracted disc of sky inside the critical angle, ringed by total internal reflection showing the mirrored world below.
- Depth-dependent colour. A 120 m pit, a 25β46 m basin and a shallow shelf are all readable from the colour alone: turquoise with pale sand visible through a few metres, blue-teal in the basin, deep indigo over the pit. Red is extinguished roughly ten times faster than blue.
- Glitter, foam and subsurface scattering. A sub-pixel hashed specular lobe gives the sun path its sparkle rather than a smooth blur. Whitecaps are gated on crest steepness with a torn threshold and an asymmetric decay trail, so they read as breaking crests rather than a film of white. Wave crests glow green-teal when the sun is behind them.
The world
4 kmΒ² of seabed from layered noise β shelf, boulder fields, reef flats, a canyon system and a trench β surfaced with a camera-snapped clipmap. Around 35,000 coral instances across eight procedurally generated species, kelp forests that sway with the same current as the surface swell, 900 fish in 28 schools running a spatial-hashed boids simulation that flees from predators and from you, 173 jellyfish with bioluminescent pulses, drifting plankton lit by forward scattering, bubble columns, whales and manta rays on long paths, and cloud shadows sweeping the whole thing.
Controls
Drag to look, W A S D to move, E/Q for up and down, Shift to sprint.
1β6 cycle weather presets, F cycles camera mode (including a scripted dive
you can also just fall into by swimming down), Tab opens the control panel,
H toggles the readout. Around 30 settings are live in the panel.
There is a whole second world below the waterline. Dive into it.
How it is built
36 source modules, each a plain classic script talking to one global AW
namespace, assembled into a single file by a dependency-free build script. Every
GLSL program is assembled from named chunks and any compile error is reported
back to the chunk and line that caused it.