1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
|
\c\This file was generated using a tool\c\
\h1\func_packing methods\h1\
The following methods are all part of the \b\func_packing methods\b\.
Provides GLSL functions to pack and unpack half, single and double-precision floating point values into more compact integer types.
\h2\Table of contents\h2\
\ul\
\-\\url #packdouble2x32-function\\b\packDouble2x32\b\ function\url\
\-\\url #packhalf2x16-function\\b\packHalf2x16\b\ function\url\
\-\\url #packsnorm2x16-function\\b\packSnorm2x16\b\ function\url\
\-\\url #packsnorm4x8-function\\b\packSnorm4x8\b\ function\url\
\-\\url #packunorm2x16-function\\b\packUnorm2x16\b\ function\url\
\-\\url #packunorm4x8-function\\b\packUnorm4x8\b\ function\url\
\-\\url #unpackdouble2x32-function\\b\unpackDouble2x32\b\ function\url\
\-\\url #unpackhalf2x16-function\\b\unpackHalf2x16\b\ function\url\
\-\\url #unpacksnorm2x16-function\\b\unpackSnorm2x16\b\ function\url\
\-\\url #unpacksnorm4x8-function\\b\unpackSnorm4x8\b\ function\url\
\-\\url #unpackunorm2x16-function\\b\unpackUnorm2x16\b\ function\url\
\-\\url #unpackunorm4x8-function\\b\unpackUnorm4x8\b\ function\url\
\ul\
\h3\packDouble2x32() function\h3\
\raw\#### <code>glm.<code>**packDouble2x32**(**v**: *uvec2*) -\\> *float*</code></code>\raw\
\raw\  \raw\Returns a double-qualifier value obtained by packing the components of \code\v\code\ into a 64-bit
\raw\  \raw\value. If an IEEE 754 \code\Inf\code\ or \code\NaN\code\ is created, it will not signal, and the resulting floating
\raw\  \raw\point value is unspecified. Otherwise, the bit-level representation of \code\v\code\ is preserved. The
\raw\  \raw\first vector component specifies the 32 least significant bits; the second component
\raw\  \raw\specifies the 32 most significant bits.
\h3\packHalf2x16() function\h3\
\raw\#### <code>glm.<code>**packHalf2x16**(**v**: *vec2*) -\\> *int*</code></code>\raw\
\raw\  \raw\Returns an unsigned integer obtained by converting the components of a two-component
\raw\  \raw\floating-point vector to the 16-bit floating-point representation found in the OpenGL
\raw\  \raw\Specification, and then packing these two 16-bit integers into a 32-bit unsigned integer.
\raw\  \raw\The first vector component specifies the 16 least-significant bits of the result; the
\raw\  \raw\second component specifies the 16 most-significant bits.
\h3\packSnorm2x16() function\h3\
\raw\#### <code>glm.<code>**packSnorm2x16**(**v**: *vec2*) -\\> *int*</code></code>\raw\
\raw\  \raw\First, converts each component of the normalized floating-point value \code\v\code\ into 8- or 16-bit
\raw\  \raw\integer values. Then, the results are packed into the returned 32-bit unsigned integer.
\raw\  \raw\The conversion for component \code\c\code\ of \code\v\code\ to fixed point is done as follows :
\raw\  \raw\\code\round(clamp(v, -1, +1) * 32767.0)\code\. The first component of the vector will be written to
\raw\  \raw\the least significant bits of the output; the last component will be written to the most
\raw\  \raw\significant bits.
\h3\packSnorm4x8() function\h3\
\raw\#### <code>glm.<code>**packSnorm4x8**(**v**: *vec4*) -\\> *int*</code></code>\raw\
\raw\  \raw\First, converts each component of the normalized floating-point value \code\v\code\ into 8- or 16-bit
\raw\  \raw\integer values. Then, the results are packed into the returned 32-bit unsigned integer.
\raw\  \raw\The conversion for component \code\c\code\ of \code\v\code\ to fixed point is done as follows :
\raw\  \raw\\code\round(clamp(c, -1, +1) * 127.0)\code\. The first component of the vector will be written to
\raw\  \raw\the least significant bits of the output; the last component will be written to the most
\raw\  \raw\significant bits.
\h3\packUnorm2x16() function\h3\
\raw\#### <code>glm.<code>**packUnorm2x16**(**v**: *vec2*) -\\> *int*</code></code>\raw\
\raw\  \raw\First, converts each component of the normalized floating-point value \code\v\code\ into 8- or 16-bit
\raw\  \raw\integer values. Then, the results are packed into the returned 32-bit unsigned integer.
\raw\  \raw\The conversion for component \code\c\code\ of \code\v\code\ to fixed point is done as follows :
\raw\  \raw\\code\round(clamp(c, 0, +1) * 65535.0)\code\. The first component of the vector will be written to the
\raw\  \raw\least significant bits of the output; the last component will be written to the most
\raw\  \raw\significant bits.
\h3\packUnorm4x8() function\h3\
\raw\#### <code>glm.<code>**packUnorm4x8**(**v**: *vec4*) -\\> *int*</code></code>\raw\
\raw\  \raw\First, converts each component of the normalized floating-point value \code\v\code\ into 8- or 16-bit
\raw\  \raw\integer values. Then, the results are packed into the returned 32-bit unsigned integer.
\raw\  \raw\The conversion for component \code\c\code\ of \code\v\code\ to fixed point is done as follows :
\raw\  \raw\\code\round(clamp(c, 0, +1) * 255.0)\code\. The first component of the vector will be written to the
\raw\  \raw\least significant bits of the output; the last component will be written to the most
\raw\  \raw\significant bits.
\h3\unpackDouble2x32() function\h3\
\raw\#### <code>glm.<code>**unpackDouble2x32**(**v**: *double*) -\\> *uvec2*</code></code>\raw\
\raw\  \raw\Returns a two-component unsigned integer vector representation of \code\v\code\. The bit-level
\raw\  \raw\representation of \code\v\code\ is preserved. The first component of the vector contains the 32 least
\raw\  \raw\significant bits of the double; the second component consists the 32 most significant bits.
\h3\unpackHalf2x16() function\h3\
\raw\#### <code>glm.<code>**unpackHalf2x16**(**v**: *int*) -\\> *vec2*</code></code>\raw\
\raw\  \raw\Returns a two-component floating-point vector with components obtained by unpacking a
\raw\  \raw\32-bit unsigned integer into a pair of 16-bit values, interpreting those values as 16-bit
\raw\  \raw\floating-point numbers according to the OpenGL Specification, and converting them to 32-bit
\raw\  \raw\floating-point values. The first component of the vector is obtained from the 16
\raw\  \raw\least-significant bits of \code\v\code\; the second component is obtained from the 16
\raw\  \raw\most-significant bits of \code\v\code\.
\h3\unpackSnorm2x16() function\h3\
\raw\#### <code>glm.<code>**unpackSnorm2x16**(**p**: *int*) -\\> *vec2*</code></code>\raw\
\raw\  \raw\First, unpacks a single 32-bit unsigned integer \code\p\code\ into a pair of 16-bit unsigned integers,
\raw\  \raw\four 8-bit unsigned integers, or four 8-bit signed integers. Then, each component is
\raw\  \raw\converted to a normalized floating-point value to generate the returned two- or
\raw\  \raw\four-component vector. The conversion for unpacked fixed-point value \code\f\code\ to floating point
\raw\  \raw\is done as follows : \code\clamp(f / 32767.0, -1, +1)\code\. The first component of
\raw\  \raw\the returned vector will be extracted from the least significant bits of the input; the
\raw\  \raw\last component will be extracted from the most significant bits.
\h3\unpackSnorm4x8() function\h3\
\raw\#### <code>glm.<code>**unpackSnorm4x8**(**p**: *int*) -\\> *vec4*</code></code>\raw\
\raw\  \raw\First, unpacks a single 32-bit unsigned integer \code\p\code\ into a pair of 16-bit unsigned integers,
\raw\  \raw\four 8-bit unsigned integers, or four 8-bit signed integers. Then, each component is
\raw\  \raw\converted to a normalized floating-point value to generate the returned two- or
\raw\  \raw\four-component vector. The conversion for unpacked fixed-point value \code\f\code\ to floating point
\raw\  \raw\is done as follows : \code\clamp(f / 127.0, -1, +1)\code\. The first component of the
\raw\  \raw\returned vector will be extracted from the least significant bits of the input; the last
\raw\  \raw\component will be extracted from the most significant bits.
\h3\unpackUnorm2x16() function\h3\
\raw\#### <code>glm.<code>**unpackUnorm2x16**(**p**: *int*) -\\> *vec2*</code></code>\raw\
\raw\  \raw\First, unpacks a single 32-bit unsigned integer \code\p\code\ into a pair of 16-bit unsigned integers,
\raw\  \raw\four 8-bit unsigned integers, or four 8-bit signed integers. Then, each component is
\raw\  \raw\converted to a normalized floating-point value to generate the returned two- or
\raw\  \raw\four-component vector. The conversion for unpacked fixed-point value \code\f\code\ to floating point
\raw\  \raw\is done as follows : \code\f / 65535.0\code\. The first component of the returned
\raw\  \raw\vector will be extracted from the least significant bits of the input; the last component
\raw\  \raw\will be extracted from the most significant bits.
\h3\unpackUnorm4x8() function\h3\
\raw\#### <code>glm.<code>**unpackUnorm4x8**(**p**: *int*) -\\> *vec4*</code></code>\raw\
\raw\  \raw\First, unpacks a single 32-bit unsigned integer \code\p\code\ into a pair of 16-bit unsigned integers,
\raw\  \raw\four 8-bit unsigned integers, or four 8-bit signed integers. Then, each component is
\raw\  \raw\converted to a normalized floating-point value to generate the returned two- or
\raw\  \raw\four-component vector. The conversion for unpacked fixed-point value \code\f\code\ to floating point
\raw\  \raw\is done as follows : \code\f / 255.0\code\. The first component of the returned vector
\raw\  \raw\will be extracted from the least significant bits of the input; the last component will be
\raw\  \raw\extracted from the most significant bits.
|