Cloth Shader follows wind direction (red arrow).
Wind based wave rotation is disabled here. Flags are the focus today.
The goal with this shader was to create a convincing flag, flattering in the wind of a ship's mast. nCloth or other real-time solutions are not possible for performance reasons. The result of this project is a mostly mathematically based shader with additional Vertex Color pre-baked offsets. All rotation is based on the object's location and in-game wind direction.
The final imported mesh in-engine is a flat plane - the rest is shader magic.
To create additional motion a one-axis heightmap was baked in Substance Designer, the high-poly being a quick cloth simulation in Blender. The resulting Normal and Heightmaps were placed in the R-G and B channel of the flag's Vertex Color.
Big thanks to my buddy Kay who's brain and unlimited power helped greatly!