I'll build a 3D aquarium with React Three Fiber. Let me check the existing setup files first.
React 19 with Tailwind v4. Now I'll install the 3D and UI packages.
Let me install latest versions (v9 fiber supports React 19 by default).
Packages installed. Now I'll create the core library modules: tank layout/constants, procedural textures, the feeding store, and a shared fish registry.
Now the zustand feeding store and the shared fish-position registry (used for schooling separation).
Now the star of the show — the procedural fish with realistic swim behavior (steering, banking, tail undulation, hunting AI).
Quick fix for the unused variable, then the fish population config.
Now the aquarium structure — glass tank, frame, sand, water surface, and animated caustic light.
Now the decorations — rocks, swaying plants, corals, pebbles, air stones, and light shafts.
The Pebbles component got garbled — let me rewrite it cleanly.
Now the interactive elements: food pellets, bubbles/puffs, drifting particles, camera rig, and click-to-feed.
Now the marine snow particles, parallax camera rig, and click-to-feed handler.
Now the main App that assembles the scene, lighting, post-processing, and the UI overlay.
Now updating index.html with title and fonts, plus base CSS.
Now let's build to verify everything compiles.
Build succeeded. Now let me polish a few physical details: tighten swim bounds so fish noses never clip the glass, fix a click-hold ordering bug, and boost light intensities for the physically-based light units in modern three.js.
Now rebuilding to confirm everything still compiles after the refinements.
The build is clean. The 3D aquarium is complete and fully interactive.
What I built
The Aquarium — a glass tank with black silicone frame and stand, rippled sand floor, procedural rocks, swaying seaweed clusters, branching corals, scattered pebbles, air stones with rising bubble streams, drifting "marine snow," animated water surface, god-ray light shafts, and scrolling caustic light patterns dancing on the sand. Soft shadows, fog depth, and subtle bloom complete the underwater mood.
The Fish — 12 procedurally built residents, each unique:
- Varied looks: 12 tropical palettes (clownfish orange, blue tang, yellow, magenta, teal…) with individually generated skin textures — dorsal-to-belly gradients, vertical bars, speckles, iridescent sheen — and sizes from 0.64× to 1.28×
- Realistic swimming: steering with smooth acceleration, banking into turns, speed-driven tail wag with body undulation, pectoral-fin sculling, idle hovering, wall/obstacle avoidance, and gentle schooling separation
Feeding gameplay:
- Left-click anywhere in the water drops a pellet there (hold to sprinkle continuously); pellets wobble as they sink and come to rest on the sand
- Each fish independently targets the food piece closest to it, darts at hunt speed, throttles down for the final strike, and gulps it with a squash-and-stretch chomp plus a tiny bubble puff
- Fish that get beat to a pellet instantly retarget the next nearest one; once the tank is clean, everyone calmly resumes wandering
- The HUD tracks pellets remaining vs. eaten and switches to a "Dinner time" state while the hunt is on
The camera auto-frames the tank on any screen size and drifts with your pointer for a subtle parallax "looking into water" feel.
Files built: src/lib/layout.ts, src/lib/textures.ts, src/store.ts, src/scene/registry.ts, src/scene/Fish.tsx, src/scene/Fishes.tsx, src/scene/Aquarium.tsx, src/scene/Decor.tsx, src/scene/Foods.tsx, src/scene/Bubbles.tsx, src/scene/Snow.tsx, src/scene/CameraRig.tsx, src/scene/ClickToFeed.tsx, src/App.tsx, index.html, src/index.css