Your browser cannot display this experiment (WebGL 2 required).
Experiment #03 · October 2026
Fighting fish
A fighting fish in its blackwater home, written entirely in code: the body, the crown-shaped fins, the habits. He comes to look at a finger on the glass, rises to breathe at the surface, blows his bubble nest and puts on a display for his own reflection.
Here he comes…
Hover over or touch the glass: he comes to look. A click feeds him. The swatches change his colours.
The idea
Betta splendens comes from the central plain of Thailand: rice paddies, marshes, floodplains. The water there is shallow, warm, low in oxygen and stained by dead leaves. The fish copes thanks to its labyrinth, an organ that lets it breathe air: every so often, it rises to the surface for a gulp.
The male defends his territory. Faced with a rival, or his own reflection, he spreads his gill covers, opens every fin and deepens his colours: this display is what earned him his name (pla kat in Thai, “the biting fish”). The rest of the time, he builds a bubble nest under a leaf, where he will guard the eggs.
The wild fish is brownish green, with short fins. Domesticated more than a thousand years ago for fights, much like cockfighting, it was later bred for beauty: ever longer fins, ever brighter colours. The crowntail, whose rays reach beyond the membrane, has only existed since 1997: it was created by the Indonesian breeder Achmad Yusuf. The swatches move from one variety to another, from the wild form to today’s strains.
The mirror fades away on its own after thirty seconds: for a real fish, a display that lasts too long is exhausting.
How it works
Nothing is modelled by hand or loaded: the fish is recomputed every frame. Its spine is a chain of 25 segments that follow the head with a delay, so the body bends into turns and ripples as it speeds up. The skin is stretched over that spine, and the overlapping scales are drawn by the graphics card.
Each fin is a fan of rays, and each ray a chain of points, pulled by springs towards its resting shape and slowed by the water: when the fish turns, the veils trail, droop and ripple on their own. The membrane is stretched between the rays; on a crowntail it pulls back between them and lets the rays stick out, splitting in two at the tips.
The light comes from the sun, filtered through the surface: a network of caustics, computed separately, dances over the fish and the bottom. Blackwater absorbs blue faster than red: the deeper you go, the more amber everything turns.
- Rendering
- Three.js, WebGL 2
- Fins
- 105 rays, 1,231 simulated points
- Habits
- curiosity, display, breathing, nest, feeding
- Colours
- Copper, Black samurai, Koi, Wild
Aqua+ Betta, the app
The fighting fish also lives in your pocket: Aqua+ Betta is out on iPhone, iPad and Android. It has both ways of watching him: the contemplative aquarium, where he goes about his life, and the interactive mode, where he comes to check your finger. Add a tank to decorate, water that moves when you tilt the phone and light that follows the time of day. The app is free; Betta+ unlocks full customisation of his colours.
iPhone, iPad and Android · free, with Betta+ in-app purchase.
Screensaver
The fighting fish also comes as a Windows screensaver: one fish per screen, each in his own colours, living his life while the computer rests. It works offline.
Download for WindowsWindows 10 or 11 · 200 KB zip · unzip it, then run Install.cmd. The program is built on your computer from its source code, which is included and readable.
A nod to Deskworlds by Chase Lean, whose betta made us want to write our own. The fish, the setting and the code are ours.
← All experiments