2

Are the floats 32 bits, since that is what I provide it, or are they the precision of a highp float?

Xavier
  • 8,828
  • 13
  • 64
  • 98
  • Is this in your vertex shader or fragment shader? In OpenGL ES 2.0, you have to define this precision in the fragment shader, so there it would be dictated by the lowp, mediump, or highp qualifier you specified (I believe you get a shader compilation error otherwise). – Brad Larson Aug 16 '11 at 16:46

1 Answers1

2

If you absolutely need to use highp, specify it in the shader.

uniform highp mat4 m;

You can also test for what precisions are available with glGetShaderPrecisionFormat. As for what is being used be default, it varies between different hardware and even different shader stages.

Darcy Rayner
  • 3,385
  • 1
  • 23
  • 15
  • What I don't understand is if by default 32 bits is used to define the float of a uniform 4x4 matrix. This is what I would hope for since the values I pass the API are float32. I'm curious if I'm getting less precision than that since when I look at the spec I only see talk about lowp, mediump, and highp. – Xavier Aug 16 '11 at 01:10
  • Yes, you could be losing precision, it all depends on how the hardware implements floating point precision. The highp, mediump and mediump qualifiers all specify a minimum required range of precision. How the hardware implements this precision varies from machine to machine. – Darcy Rayner Aug 16 '11 at 01:34