For example, a watermark picture affixed to a quad, and then let Quad each vertex of the s texture coordinate with the time increment, so that the flow effect, that is, the s coordinate of each vertex is calculated according to the following formula:
S=s0+time*speed
Where S0 is the initial s-coordinate value.
However, the problem is that shader in the texture coordinate v_texcoord precision is very limited, usually mediump float, so as time increases, the value of s will become very large, will soon cause v_texcoord overflow, when rendering effect will become abnormal, Usually the flow effect is stuck and accompanied by a mosaic, so we want to wrap the texture coordinates to a smaller range of values by adding the integer multiples of 1, and then passing in the shader.
But here's one thing to keep in mind, when we do wrap, we're going to quad all the vertices together, not the vertices individually, for example, if we want to reduce the s-coordinate of a vertex by 1, we must also subtract 1 of the other vertices synchronously. For example, after a little time, the quad texture coordinates become as follows:
The s of all vertices are reduced by 1, which becomes:
Both show the same result.
However, if you wrap the vertices individually, the following results may occur:
Obviously, it's not right.
Issues to note for mobile mapping