PDA

View Full Version : precision highp int?



qqca
06-29-2010, 10:57 AM
Hi ,

I can understand the precision qualifier like "precision mediump float" but what's the point for assigning "precision mediump int"? Are there any differences between "precision highp int" & "precision mediump int"? I mean for an Interger, the floating point precision does not make any sense. Or does the highp or mediump refers to 64bit or 32 bit integer?

Thanks,

-Mike

Xmas
07-01-2010, 02:10 AM
Have a look at section 4.5.2 of the GLSL ES spec (http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf).

The minimum ranges that OpenGL ES 2.0 implementations have to support for integers are:
lowp [-255, +255]
mediump [-1023, +1023]
highp [-65535, +65535]

Support for integers is quite limited in GLSL ES, and the ranges are chosen so that mediump and highp ints may be implemented using mediump and highp floats, respectively.