packUnorm2x16, packSnorm2x16 — pack floating-point values into an unsigned integer
uint packUnorm2x16( | vec2 v); |
uint packSnorm2x16( | vec2 v); |
packUnorm2x16 and packSnorm2x16 converts
each component of the normalized floating-point value v into 16-bit integer
values and then packs the results into a 32-bit unsigned intgeter.
The conversion for component c of v to fixed-point is
performed as follows:
packUnorm2x16: round(clamp(
c, 0.0, 1.0) * 65535.0)
packSnorm2x16: round(clamp(
c, -1.0, 1.0) * 32767.0)
The first component of the vector will be written to the least significant bits of the output; the last component will be written to the most significant bits.