Dynamic Panner speed


Basically I would like to make a water stream that goes faster if the slope is higher.
So using ‘VertexNormalWS’ node and some more computations I was able to make a gradient that goes from 0 to 1 from top to bottom:


Than I tried to multiply my time by previous gradient:


As you can see, the texture looks a single color. If I remove the time multiplier it looks normal:


It looks solid color because it’s “stitching”. If I try to “posterize” (not sure it’s how you say it) the gradient by doing (Floor(Gradient * 10) / 10),
it gives me this:


Any idea how to do this please?

Get VertexNormals, dot it with (0,0,1) vector, Abs and OneMinus result -> this will provide you slopes mask.

Then… Imagine how it works.
You trying to move texture over surface, but according to slopes mask, it moves faster in one place, and slower in another. What will appears between this areas? “Accumulated pixels”. This is what you see on second screen. It looks as single color because Time node provides global time, very big value of time, and there are so many accumulated pixels on your surface.
And there is no way to fix that in this case.

But you can, for example, use slopes mask to Lerp 2 movable textures with different speeds.
Or use something similar to “Flow” algorithm, where 2 textures accumulates distortion, but reset with specified period. Look “Flow” material functions in Editor.

Thanks! Flow was exactly what I needed !