I need to run both sprite animations and animated coordinates.
That is, a texture coordinate in [0, 1] is given for some specific sprite in an animation, and then it gets translated by another coordinate.
The translation can result in coordinates outside of [0, 1], and this is needed for repeating.
The problem is this - I supply the sprites as a texture atlas. Therefore, selecting a sprite means getting a sub-rectangle in [0, 1]. Because this sprite is in between others, there is no way to get repeating - after all, if the texture coordinate moves outside of the sprite's rectangle, other sprites will be sampled.
The sprites are given in a texture atlas as a necessity - I am using instanced rendering, where each instance can use any sprite in the animation, and the only way to implement that, as far as I know, is with a texture atlas (or a texture array etc. in OpenGL).
tl;dr - is there a way to achieve both texture repeating, and sprite animations, in WebGL?
newUV = firstFrameU + ((index % frame_count) * spriteWidth)
etc for horizontal. – Jeroen van Langen