Procedural River Material issue

Hey,
I am creating a procedural river, which shape depends on a spline. This works great, but i have an issue with the material. In order to get the flow direction to the material, I use the spline direction at distance function in c++ and feed the information to my vertex colors with this code down here.

ForwardVector = spline->GetDirectionAtDistanceAlongSpline(SplinePointDistance[i] + (y*Ynumb), ESplineCoordinateSpace::World); uint8 XVertexColor = (ForwardVector.X*127.5) + 127.5; uint8 YVertexColor = (ForwardVector.Y*127.5) + 127.5; //some lines below ColorsVertex.Add(FColor(XVertexColor,YVertexColor, 0));

My Material looks like following:

The Problem is that the river material gets difformed more and more after pressing start.

266096-nicepic.png

266093-screenshot-31.png

So when somebody has an idea to fix this problem, please write it down. In Addition i use shared vertices, and between two spline points is always a mesh section. I already made it work, when I use the same direction for each vertex per meshsection. (looks not so nice)