Short description of the issue:
Tropical fish render thin stray lines around their fins at certain view angles. The lines are colored by the pattern texture and differ per pattern, for example Anemone shows them and Goatfish does not. Both body models are affected. On large fish the lines are clearly visible, on normal sized fish they are subpixel at typical viewing distances but visible when viewing the fish up close.
Steps to reproduce the issue:
Summon a large tropical fish with the command at the bottom of this description, then look at it from angles below and beside it, and observe hair-thin lines extending along the fins.
Expected result:
No stray lines at any size or angle.
Actual result:
Thin stray lines render around the fins, colored by the pattern texture.
Cause:
The fins and tail of both tropical fish models are zero thickness boxes. The pattern overlay layer is baked with a uniform 0.008 inflation (LayerDefinitions.FISH_PATTERN_DEFORMATION), which gives those flat parts a 0.016 thickness in the pattern layer only. Their four edge faces then have real area and render as thin strips. The strips sample a zero width strip of the pattern texture, which is why visibility depends on the pattern’s edge texels and why the lines scale with the fish’s size.
Fix:
Bake the inflated pattern layer with a per axis deformation that does not grow each part’s flat axis. The body keeps its anti z-fighting inflation and the fins stay flat, so the edge faces keep zero area and the lines disappear. Concretely, replace the uniform deformation with new CubeDeformation(0.0F, g, g) for parts that are flat on X (tail, top fin, bottom fin) and new CubeDeformation(g, g, 0.0F) for parts that are flat on Z (left and right fin). Verified in game with a toggleable client mod implementing exactly this, with the rebuilt layer the lines are gone on every pattern and size, with the vanilla layer they return.
Version history:
Present since tropical fish were added in 1.13. The 0.008 pattern inflation is in the pattern layer class of every version checked (1.13, 1.14.4, 1.16.5, 1.17.1, 1.20.6, 26.1.2, 26.2, verified by inspecting the class files of Mojang’s official client jars). The lines have been visually reproduced in both 1.13 and 26.2.
Command used in the steps:
/summon minecraft:tropical_fish ~ ~2 ~ {NoAI:1b,NoGravity:1b,Invulnerable:1b,Variant:185008385,attributes:[{id:"minecraft:scale",base:6}]}Environment
Reproduced in vanilla with no resource packs. The cause is in the model bake, so it is hardware independent. Tested on Windows 11, NVIDIA RTX 3080 Ti.