Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Noise Algorithm Problem (GLES)

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2012
    Posts
    12

    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?

  2. #2
    Member Regular Contributor
    Join Date
    Dec 2009
    Posts
    251
    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.

  3. #3
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,575
    Is it possible to access to more precision with this phone ?

  4. #4
    Junior Member Newbie
    Join Date
    Jun 2012
    Posts
    12
    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
  •