Fish Vertex Animation

Hi,

I’m trying to reproduce this shader which allows vertices to move to create a swiming fish animation.
https://www.artstation.com/artwork/YaLr9q
The first thing I have trouble to reproduce is translation on one axis.
I also don’t have any idea how to achieve this step “Next, using a panning sine wave, I created a yaw that pans down the tail.” and especially how to apply it only to the tail.
I would really appreciate any help because I don’t really now which direction to go.

You can either pass in a Vector3 to define the local axis (and scale), or pick a component to modify by splitting the float3 value coming out of the Position node, adding your offset (the sine wave) to it, and reconstructing a Vector3 value from the original position and the modified component. If your fish model is aligned so that it’s z forward, y up like Unity, then you would want to use the x (or R) component, or use a Vector3 of (1,0,0).

This means offset the time (add a value to it) before using as the input into the Sine node. This can be from a UV, or a the position value. Picking a single component from the position will probably work well, like z (B) if the alignment is like mentioned above. Multiply that, add it to time, pipe into sine.

Could be manually painted onto the model using a vertex color, or extra UV. Or you could use the position again and remap the object space position. Lots of ways to do this part. If the tutorial you’re reading isn’t telling you how to do that, I might suggest looking for another tutorial. There are plenty I’ve seen that handle this kind of topic that go into great detail on how exactly to do it.

So for the first part I modify the shader like this but I ended up with an invisible object for some reasons

The position input on the master node is a float3 value (as denoted by the “(3)” next to the “Position” text) and you’re passing in just the single x component. That means you’re essential constructing an infinitely thin mesh since all of the vertex positions are in a single diagonal line. You need to be piping in a full float3 position, offset only along the one direction.

Add a Vector3 node, pipe in the output of the Add node into the R(1) and the G(1) and B(1) of the split node into the same inputs on the Vector3 node.

Hi bgolus,
Apologies to open this can of worms again over two years later but I followed your advice and it worked great! The only problem is that I can’t seem to get a similar effect to work for a rotation that travels along the z axis (panning roll), and was wondering if you had any ideas on how to get this to work.

I’ve been frantically googling but can’t seem to find anything, especially shader graph related. Any help would be greatly appreciated