…
vec3 color = texture2D(u_texture, v_texcoord);
gl_FragColor.rgb = color + vec3(rand(gl_FragCoord.xy + time / 1000.0));
…
The code generates perfectly the expected noise in Samsung Galaxy S1 and Google Nexus S. But it fails completely in the new smartphone which uses ARM’s Mali-400/MP4.
Anyone can spot anything wrong with this algorithm? Or maybe understand why could it fail?
Mali fragment programs use a 16-bit float type by default (with 10 bits mantissa), so that the argument to fract probably will not have enough precision to store any fractional digits.