Skip to content

Levitating School Hero

A school of butterfly koi hangs in the dry air of a concrete room, inside one shaft of light. The water they belong to is held in the ceiling. The light draws caustics on the floor, and every fish casts its shadow through the beam. Rest the pointer and they come to look; click and they scatter.

WebGL20 deps1 file · 85 KB TSXreduced-motion aware

ProAttentionminimal
Preview

Props

6
1
0.85
1
1
Fish notice the pointer
A fish looks at you
Pause control
Show sample copy

The source is part of Pro

$27/month or $179 once. See Pro

No runtime dependencies
"use client";

import { useEffect, useRef, useState } from "react";
import type { CSSProperties, ReactNode } from "react";

/**
 * LevitatingSchoolHero: a school of butterfly koi hanging in the dry air of a
 * concrete room, inside one shaft of light. The water they belong to is held
 * in a square opening in the ceiling; the light falls through it, draws
 * caustics on the floor and long streaks in the haze, and every fish casts a
 * shadow through the beam and onto the lit patch. Nothing else in the room is
 * wrong.
 *
 * HOW IT IS MADE. Hand-written WebGL2, four passes a frame, no dependencies:
 *   1. a shadow map: the fish drawn from the light's point of view;
 *   2. the fish: instanced meshes with a travelling-wave swim in the vertex
 *      shader, wet specular, scales, translucent veined fins, eyes;
 *   3. the room: one full-screen pass that ray-casts an analytic box room,

  // ---------------------------------------------------------------
  // Full source available with a viberdy Pro subscription.
  // https://viberdy.dev/pricing
  // ---------------------------------------------------------------
}
Details

About this heroe

Most hero backgrounds are moods. This one is a scene with exactly one thing wrong. A concrete room, formwork seams and tie holes on the walls, a square opening in the ceiling that holds water. Sunlight falls through the water as a single shaft. Inside it, a school of butterfly koi hangs in the dry air, long fins trailing: mostly red-and-white kohaku, now and then a metallic gold ogon. The shaft is ray-marched through the haze, and the streaks inside it are the real caustic filaments, which sharpen as the light falls. Every fish casts a shadow through the beam and onto the lit patch of floor, where the caustics split into three wavelengths. Bubbles sink from the water. About every eleven seconds one fish turns to look at the camera. Move the pointer and the room shifts a few degrees. Rest it, and the nearest fish swim over to see what it is. Click, and the fish under it bolts, shedding a few bubbles. The opening is a slow pour of light, never a flash, and a built-in Pause control stops the loop.

Curator’s note

The style's lead piece. The anomaly works because everything else is obedient: a real room, one motivated light, physically placed caustics, and fish whose shadows cut through the haze. Only the water is missing. The fish are lofted from a single profile function, so an agent can turn the school into goldfish, rays or paper boats without touching the light.

Pairs well with

Pro
Pro
Pro

Dry Caustic Room

backgrounds