

Thus GL_RGBA8I gives a signed integer format where each of the four components is an integer on the range. Thus, GL_RGBA32F is a floating-point format where each component is a 32-bit IEEE floating-point value. "_SNORM": Signed normalized integer format."": No type suffix means unsigned normalized integer format.The type indicates which of the 5 types mentioned above the format is stored as. The size is the bitdepth for each component. OpenGL only allows "R", "RG", "RGB", or "RGBA" other combinations are not allowed as internal image formats. The components field is the list of components that the format stores. OpenGL has a particular syntax for writing its color format enumerants. Note: Texture swizzling can change what the missing values are. Zeros are used if R, G, or B is missing, while a missing Alpha always resolves to 1. The components not stored by the image format are filled in automatically. When the shader samples such a texture, it will still resolve to a 4-value RGBA vector. Image formats do not have to store each component. Signed integers are 2's complement integer values. Integral formats are also divided into signed and unsigned integers. Unsigned normalized integers store floating-point values on the range, while signed normalized integers store values on the range.

Normalized integer formats themselves are broken down into 2 kinds: unsigned normalized and signed normalized. Both normalized integer and floating-point formats will resolve, in the shader, to a vector of floating-point values, whereas integral formats will resolve to a vector of integers. They're just numbers it's how you use them that defines their meaning.Ĭolor formats can be stored in one of 3 ways: normalized integers, floating-point, or integral. Shaders are arbitrary programs they can consider a color value to represent a texture coordinate, a Fresnel index, a normal, or anything else they so desire. Note: Technically, any of the 4 color values can take on whatever meaning you give them in a shader.
