UNPACKUNORM(3G)

    .SH "NAME" unpackUnorm2x16,_unpackUnorm4x8,_unpackSnorm4x8 - unpack floating-point values from an unsigned integer
    .SH "DECLARATION"

            .HP u vec2 unpackUnorm2x16(uint p);
            .HP u vec2 unpackSnorm2x16(uint p);
            .HP u vec4 unpackUnorm4x8(uint p);
            .HP u vec4 unpackSnorm4x8(uint p);

    .SH "PARAMETERS"

        .PP p

                    Specifies an unsigned integer containing packed floating-point values.

            .RE

        .SH "DESCRIPTION"
            .PP unpackUnorm2x16, unpackSnorm2x16, unpackUnorm4x8 and unpackSnorm4x8 unpack single 32-bit unsigned integers, specified in the parameter p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers or four 8-bit signed integers. Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
            .PP The conversion for unpacked fixed point value f to floating-point is performed as follows:

        • packUnorm2x16: f / 65535.0

        • packSnorm2x16: clamp(f / 32727.0, -1.0, 1.0)

        • packUnorm4x8: f / 255.0

        • packSnorm4x8: clamp(f / 127.0, -1.0, 1.0)

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

        .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{ unpackUnorm2x16 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{ unpackSnorm2x16 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{ unpackUnorm4x8 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{ unpackSnorm4x8 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 packUnorm2x16, packUnorm4x8, packSnorm4x8

        .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