text - Best way to animate textures in OpenGL ES 2.0 -
i want animate numbers in opengl es 2.0. try , make work start have created timer , trying numbers change dependant on timer. timer set on sin() wave numbers should increase decrease again. numbers on top line of texture atlas increasing texture coordinates in x direction moves next number. have tried using fragment shader if statements move texture coordinates have had no luck. im sure there must better way of doing this. fragment shader char fragshader[] = "precision highp float;\n" "varying highp vec2 texturecoordinate;\n" "uniform sampler2d texture;\n" "uniform float time;\n" "void main()\n" "{\n" "float c1 = 0.5*sin(time)+0.5;\n" "if (c1 >= 0.0 && c1 < 0.1)" "vec2 flipped_texcoord = vec2(texturecoordinate.x, 1.0 -texturecoordinate.y);\n" "elseif (c1 >= 0.1 && c1 < 0.2)...