2
\$\begingroup\$

I am writing an app for Android, using OpenGL ES 1.x

I am confused as to whether I should use GL_FLOAT or GL_FIXED, the priority being performance regarding GPU operations(does GL_FIXED need to be converted etc. ex: GL_FIXED fits EXACTLY with the precision I need but if it is converted to a float then using it is pointless).

This book seems to say that it is ALWAYS preferable to use GL_FIXED for vertices: "The major exception is with vertex data, which should never be given in floating point..." Here (paragraph right above the subtitle "Vertex data")

But I have seen others saying floating point is better..

\$\endgroup\$
  • \$\begingroup\$ Depends on the device. You should read your device's GPU docs. \$\endgroup\$ – SurvivalMachine Jun 26 '12 at 19:05
3
\$\begingroup\$

In commercial game development for TV game consoles, we never store vertex positions on disc or network as floats, because if more than 8 or 10 bits of precision is needed, a model can be subdivided until each piece requires only 8 or 10 bits.

So for speed of download or loading from a disc, floats lose out to fixed point.

As for speed of rendering, this is an issue only when vertex shading is bottlenecked by vertex buffer read bandwidth, which is actually not likely unless your vertices are really fat beyond just the position being 3x32 bits.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.