Website powered by

UE4 Vertex Animation Material

A highlight and overview of the vertex animation based shader I'd used for a recent project.

The material makes use of moving and rotating vertexes of the mesh with Vertex Paints as a mask for the mesh elements along with one or two Vector Parameters to define the pivot origin, movement direction or rotation axis.

Two custom material functions were made to contain the nodes and minimise clutter, they also had some other inputs and outputs to make chaining them together easier.

Parameters for the max movement/rotation distance could be set in the Material Instance, as well as what Vertex Mask Alpha value to use for masking out the part of the mesh you wish to move.

Vertex paint values were done inside of 3Ds Max, the Vector Parameters for the Pivot Point, Rotation axis and movement direction could be applied to the Vertex paint also but I chose to manually set these inside of UE4.

Finally each movement can be Lerped between 0 and a Scalar parameter for the maximum travel or rotation distance. I'd set up a BP to feed random changing positions to each of these Lerps updated over a timeline, but they could be easilly fed a 0 to 1 value for any other kind of input (button press, rotation etc).

A big thanks to Alex over on Youtube for his video that exposed me to this idea.

https://www.youtube.com/channel/UCzO9NOZ1ezFQQS7z4-n6Wjw

Enjoy.

The final material being driven by random 0 to 1 positions for each moving part, updated over time. It's one static mesh with no separate parts.

A Basic setup of how the material works and the two Material Functions.

A Basic setup of how the material works and the two Material Functions.

MF_VertexPaintTranslation is far more simple as no editing of the mesh normals are required.

MF_VertexPaintTranslation is far more simple as no editing of the mesh normals are required.

MF_VertexPaintRotation is required editing/updating of the normals to account for rotation, else the normals would be incorrect as the mesh rotates.

MF_VertexPaintRotation is required editing/updating of the normals to account for rotation, else the normals would be incorrect as the mesh rotates.