Noise Algorithm Problem (GLES)

I am struggling to get the next simple algorithm working in the Samsung Galaxy SIII

float rand(vec2 co)
{
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
}


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.

Is it possible to access to more precision with this phone ?

So I tried to put high precision by prefixing the float with highp. And I’ve got the next compiler error:

“High precision not supported, instead compiling high precision as medium precision”

If this then a precision issue? and if so, what alternatives to I have?

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.