-
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?
-
Junior Member
Regular Contributor
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.
-
Super Moderator
OpenGL Lord
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?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules