Wednesday, April 11, 2018

Converting float to int using bits

Sometimes it makes sense to place an integer into an array of floats but not want to represent it a float.

GLSL has a function for converting the bits that represent a float to an integer and vise versa:

https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/floatBitsToInt.xhtml

No comments:

Post a Comment