0

What's the maximum value of integer and unsigned integer that can be used in shader?

genpfault
  • 51,148
  • 11
  • 85
  • 139

1 Answers1

2

For OpenGL ES 3.x "lowp int" must be at least 9-bit twos complement, "mediump int" must be at least 16-bit twos complement, and "highp int" must be at least 32-bit twos complement.

Precision Signed range Unsigned range
lowp -28 to 28-1 0 to 29-1
mediump -215 to 215-1 0 to 216-1
highp -231 to 231-1 0 to 232-1

Reference: Section 4.5.1 Range and Precision (page 53 in the PDF).

https://www.khronos.org/registry/OpenGL/specs/es/3.0/GLSL_ES_Specification_3.00.pdf

solidpixel
  • 10,688
  • 1
  • 20
  • 33