I have a problem with Iavra gif. Everything's ok sometimes and sometimes there's a black screen instead of the animation. How do I fix this?
#define PI 3.14
precision mediump float;
varying vec2 vTextureCoord;
uniform sampler2D uSampler;
void main(void) {',
vec2 norm = vTextureCoord * 2.0 - 1.0;
float theta = PI + norm.x * PI;
float r = (1.0 + norm.y) * 0.5;
vec2 coord = vec2(-r * sin(theta), -r * cos(theta)) / 2.0 + 0.5;
gl_FragColor = texture2D(uSampler, coord);
}