What is the precision of highp floats in GLSL ES 2.0 (for iPhone/iPod touch/iPad)?

From the OpenGL ES Shading Language reference:

  • highp – 16-bit, floating point range:
    −262 to 262, integer range: −216 to 216
  • mediump – 10 bit, floating
    point range: −214 to 214, integer
    range: −210 to 210
  • lowp – 8 bit,
    floating point range: −2 to 2,
    integer range: −28 to 28

In OpenGL ES 3 these guarantees have been upgraded, see the GLSL ES 3.00 spec:

  • highp – 24-bit, floating point range:
    −2126 to 2127, signed integer range: −231 to 231−1, unsigned integer range: 0 to 232−1
  • mediump – 10 bit, floating
    point range: −214 to 214, signed integer
    range: −215 to 215−1, unsigned integer range 0 to 216−1
  • lowp – 8/9 bit (signed/unsigned),
    floating point range: −2 to 2,
    signed integer range: −28 to 28−1, unsigned integer range 0 to 29−1

Leave a Comment