unpackUnorm2x16, unpackSnorm2x16 — unpack floating-point values from an unsigned integer
vec2 unpackUnorm2x16( | uint p); |
vec2 unpackSnorm2x16( | uint p); |
unpackUnorm2x16, unpackSnorm2x16 unpack
single 32-bit unsigned integers, specified in the parameter p into a pair of 16-bit unsigned integers.
Then, each component is converted to a normalized floating-point
value to generate the returned two- or four-component vector.
The conversion for unpacked fixed point value f to floating-point is performed as follows:
unpackUnorm2x16: f / 65535.0
unpackSnorm2x16: clamp(f / 32727.0, -1.0, 1.0)
The first component of the returned vector will be extracted from the least significant bits of the input; the last component will be extracted from the most significant bits.