Light on the scales: metallic, Ginrin and Doitsu

Platinum Ogon, Ginrin Yamabuki Ogon, Ginrin Kohaku, Doitsu Platinum Ogon

What changed

The shine on a metallic koi and the sparkle on a Ginrin koi were painted into the koi's colour texture. They were glued to the skin: however the koi turned, the same band and the same dots stayed lit. On a real koi that shimmer is the whole point. A Platinum Ogon flashes as it turns, and Ginrin scales catch the light one at a time.

So the koi is now lit. One sun sits over the pond, and the light depends on which way each bit of skin faces:

- A normal map, baked from the same pattern code. Each scale is a shallow dome, tipped a little at random, on a back that rounds off toward the flanks. It is generated like the colour, from the seed, so nothing is hand-painted and every koi still rebuilds from one number.

- A mask, also baked. How metallic, how glossy and how much Ginrin glint each point has. Gloss follows the finish gene, so a clean Champion has shinier skin than a rough Pond koi.

- A lit shader. Metal shows what it reflects, tinted by its colour: bright sky where the back faces up, dark water where the flanks turn away. As the body bends, that band slides along it. Ginrin scales each have their own heading to the sun at which they flash, so as the koi turns they flash in turn.

The baked shine is gone from the body's colour. Gallery swatches still use the old baked version, since they are flat images with no light.

Doitsu scale types

Doitsu koi used to have one look: a row of big scales down the spine. Real Doitsu come in three, so there is a new gene for it, rolled after every other gene so no existing seed changes its variety, rarity, grade or name:

Numbers

- Three textures per koi instead of one, at 256 × 64 (was one at 128 × 32), with mipmaps: about 260 KB per koi.

- Two extra texture reads and a little maths per pixel. Still one draw call per koi and SRP Batcher compatible.

- 24 EditMode tests pass, 10 of them new (normals, metallic, Ginrin, each Doitsu type, older genes unchanged).

What didn't work first

The first pass made every koi look like a reptile: each scale's tilt jumped at the edge of its grid cell, so the body read as tiles. Fading the dome and tilt to nothing at each scale's rim fixed it. The tail fin also picked up stripes, because it samples the pattern's last column, and the first Aragoke scales were small and got cut off straight at their grid cells, which left a seam along the spine. Bigger scales and checking the neighbouring cells fixed that.

Previous
Previous

A rounder, bigger Tancho

Next
Next

A tail that actually swims