Hi!
I'm working on a flowing river shader for my game Fortifend, but I can't quite figure out how to get it working the way I'd like. Maybe someone here has some shader insights/techniques that can help me!
The water flow shader is applied to a procedurally generated triangular mesh. Vertex color is used to pass flow vector and foam (water turbulence) into the shader. The vertices of each tri all have the same flow vector, but they have independent foam values.
The shader rotates the texture UV into alignment with the flow direction, and scrolls the waves in that direction. Naturally, this means that there is a visible seam between any two adjacent tris that don't have the same flow vector. Doesn't look half bad when zoomed out, but noticeably distracting close up.
I'm looking for possible solutions to this.
Is there a solution that involves setting each vertex within a tri to its own independent flow vector? For example, if I set each vertex within a tri to its own independent flow vector (for the purpose of blending the 3 flows), is there some way to pass all 3 vertex flow vectors from the vertex shader to the fragment shader? (Plus how much "influence" each vertex should have over the blend.)