Making the flow direction of a water shader relative to the applied object

I created a water material, converted it to a shader material, and added a flowing animation by adding a TIME * 0.1 factor to this line in the default script.

uv1_triplanar_pos = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz * uv1_scale + uv1_offset + TIME * 0.1;

The shader surface is now flowing with the vector -1,-1,-1. Which is regardless of the rotation of the mesh the material is applied to. To make a river, I need to be able to rotate the direction of the shader with the cubes that hold the material.

Is there a simple checkbox for this I haven’t found yet? Or what else would be the proper way to do this?

Use local space vertex coordinate for triplanar position instead of transforming it into global space. If you don’t want to intervene into shader code you can achieve the same by disabling “world triplanar” in the standard material before converting it to a shader.

Without world triplanar, the * TIME trick doesn’t seem to work anymore.

But the same effect can be achieved by adding an Animation Player to the scene and animating the mesh that holds the water shader. The UV1 Offset on the normal texture is set as the starting keyframe, then changing x to 1 to assign the ending keyframe on the animation. Works like a charm.