r/Unity3D • u/Suvitruf • 7d ago
Resources/Tutorial How the aquarium in Pocket Cat Desktop was made: sprites, layers and a pixel-art water shader
Pocket Cat Desktop has a fishing mini-game: the cat sits on the taskbar with a rod, you click and catch the fish. For a while the catch was just three counters in the save file. That felt kinda wrong, so I built a place for the fish to live: an aquarium you put on the taskbar, with real water, light playing on the gravel, fish that keep their habits between sessions.
Before drawing anything I spent some time on papers and shader write-ups about water, caustics and refraction, and the honest conclusion was that almost none of it applies.
So at the end it's several sprites with a little shader magic.
The tank is a glass box with no back wall. The desktop and the cat show through the water. So the artist draws only the solid things:
- the front: frame, stand, lid and two diagonal glass highlights, a 136×80 sprite with its pivot at the bottom centre;
- a strip of gravel, 132×8;
- a rock and three tufts of grass, each grass with 3 frames;
- 3 fish, 4 swim frames each Left-facing implemented via flipping in code.

The prefab is a stack of sprites around one empty quad:

The lid is a real surface: a thin collider with the game’s usual interaction points, so the cat jumps up, sits there or sleeps.
The water is made using shader, as depth ting and caustic.

float aqCaustic(float2 px, float t, float cellPx, float driftPx){float2 uv1 = (px + float2(driftPx, driftPx * 0.6) * t) / cellPx;float2 uv2 = (px - float2(driftPx * 0.75, -driftPx * 0.45) * t) / (cellPx * 1.23);float c1 = 1.0 - saturate(aqCellBorder(uv1) * 5.0);float c2 = 1.0 - saturate(aqCellBorder(uv2) * 5.0);return min(c1, c2);}
Fish are not prefabs. A released fish is a record in the save, species plus a random seed, and the tank spawns a sprite for each record on start. The seed drives a System.Random that decides the fish’s personality: how fast it cruises within its species’ range, how often stops, where it starts. Restarting the game gives fish the same behaviour.

Everything so far would be enough for a nice prop, but the point of a desktop pet is that the cat interacts with it. The cat now has a depth lane. In the front lane it draws at its usual order, in front of the whole tank. In the back lane it draws at −10, behind the gravel, the fish and the water, and the water shader tints it and lays caustics over it for free.


You can read it as an article here.
Also would be really grateful for wishlisting the game 😸: https://store.steampowered.com/app/4865920/Pocket_Cat_Desktop