Appendix A. GL_HALF_FLOAT
GL_HALF_FLOAT
is a vertex and texture data type supported by OpenGL ES 3.0. The GL_HALF_FLOAT
data type is used to specify 16-bit floating-point values. This can be useful, for example, in specifying vertex attributes such as texture coordinates,normals,binormals, and tangent vectors. Using GL_HALF_FLOAT
rather than GL_FLOAT
provides a two times reduction in memory bandwidth required to read vertex or texture data by the GPU.
One might argue that we can use GL_SHORT
or GL_UNSIGNED_SHORT
instead of a 16-bit floating-point data type and get the same memory footprint and bandwidth savings. However, with that approach, you will need to scale the data or matrices appropriately and apply a transform in the vertexshader. For ...
Get OpenGL ES 3.0 Programming Guide, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.