Fish Fakery |
To create the effect of fish swimming in a natural way, I scrolled the UVs of a mesh shaped like a figure-8. The fish still looked very flat though, so I tried something a little different.
I made the figure-8 non-uniform and oblong so as to appear more random. To give the fish the appearance of being in 3D, I created a second figure-8 mesh which intersected the first one. The mesh's UVs were laid out so that the first figure-8 was a view of the fish from the side, the other being from the top. The UVs were tiled so that 4 fish would show up on the mesh.
A simple shader was created using Shader Forge in Unity that would scroll the UVs along U (X-Axis) at a speed which could be set in editor.
The result is a fish that doesn't flatten like a card when viewed from an angle. This worked especially well for the pseudo-isometric camera angle we used for the map screen.
The mesh was then duplicated, moved, and rotated to make the swimming patterns of the fish seem more random.