Hello,
I’ve got a very simple animated fragment shader demonstrating the problem:
precision mediump float;
uniform mediump float time;
void main(void) {
float time = time;
gl_FragColor = vec4(vec3(sin(gl_FragCoord.x / mod(time, 100.0))), 1.0);
}
It works fine on HTC Desire S and GLSL Sandbox (glsl.heroku.com) - the animation is very fluent. On Nexus 7, however, the animation is jerky (updates around every 2 seconds). The scene is rendered at 60FPS, and other things (like geometry transformation in vertex shader) is fluent. This problem also prohibits me to use pseudo-random functions, such as:
float rand(vec2 n) {
return 0.5 + 0.5 *
fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453);
}
as they return 0 most of the time. What might cause the problem and how to get around it?