PACKUNORM(3G)

    .SH "NAME" packUnorm - pack floating-point values into an unsigned integer
    .SH "DECLARATION"

            .HP u uint packUnorm2x16(vec2 v);
            .HP u uint packSnorm2x16(vec2 v);
            .HP u uint packUnorm4x8(vec4 v);
            .HP u uint packSnorm4x8(vec4 v);

    .SH "PARAMETERS"

        .PP v

                    Specifies a vector of values to be packed into an unsigned integer.

            .RE

        .SH "DESCRIPTION"
            .PP packUnorm2x16, packSnorm2x16, packUnorm4x8 and packSnorm4x8 convert each component of the normalized floating-ponit value v into 8- or 16-bit integer values and then packs the results into a 32-bit unsigned intgeter.
            .PP 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)

        • packUnorm4x8: round(clamp(c, 0.0, 1.0) * 255.0)

        • packSnorm4x8: round(clamp(c, -1.0, 1.0) * 127.0)

            .PP 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.

        .SH "VERSION SUPPORT"
            .TS allbox tab(:); lB cB s s s s s s s s s s s lB cB cB cB cB cB cB cB cB cB cB cB cB. T{ T}:T{ OpenGL Shading Language Version T} T{ Function Name T}:T{ 1.10 T}:T{ 1.20 T}:T{ 1.30 T}:T{ 1.40 T}:T{ 1.50 T}:T{ 3.30 T}:T{ 4.00 T}:T{ 4.10 T}:T{ 4.20 T}:T{ 4.30 T}:T{ 4.40 T}:T{ 4.50 T} l c c c c c c c c c c c c l c c c c c c c c c c c c l c c c c c c c c c c c c l c c c c c c c c c c c c. T{ packUnorm2x16 T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T} T{ packSnorm2x16 T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T} T{ packUnorm4x8 T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T} T{ packSnorm4x8 T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}

        .SH "SEE ALSO"
            .PP unpackUnorm2x16, unpackSnorm2x16, unpackUnorm4x8, unpackSnorm4x8

        .SH "COPYRIGHT"
            .PP Copyright © 2011-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. https://opencontent.org/openpub/.

COPYRIGHT
Copyright © 2011-2014 Khronos Group