|
Foundation
|
Classes | |
| union | FloatBits |
Typedefs | |
| using | float4 = vec4 |
| using | float3 = vec3 |
| using | float2 = vec2 |
| using | float4x4 = mat4 |
| using | int2 = ivec2 |
| using | int3 = ivec3 |
| using | int4 = ivec4 |
| using | uint = unsigned int |
| using | uint2 = uvec2 |
| using | uint3 = uvec3 |
| using | uint4 = uvec4 |
Functions | |
| bool | decompose (mat4 const &m, float3 &scale, quat &rotation, float3 &transform) |
| mat4 | infinitePerspectiveRHReverseZ (float fovY, float a, float zNear) |
| mat4 | perspectiveRHReverseZ (float fovY, float a, float zNear, float zFar) |
| mat4 | viewMatrixRHReverseZ (vec3 pos, quat rot) |
| float4 | planeSymmetric (mat4 proj) |
| unsigned short | quantizeFP16 (float v) |
| float | quantizeFP32 (float v, int N) |
| float | dequantizeFP16 (unsigned short h) |
| float | quantizeFP32 (float v, int32_t N) |
| float | dequantizeFP16 (uint16_t h) |
| uint32_t | quantizeUnorm (float v, int32_t N) |
| float | dequantizeUnorm (int32_t q, int32_t Nbits) |
| int32_t | quantizeSnorm (float v, int32_t N) |
| float | dequantizeSnorm (int32_t q, int32_t Nbits) |
| uint32_t | quantizeSnormShifted (float v, int32_t Nbits) |
| float | dequantizeSnormShifted (uint32_t q, int32_t Nbits) |
| float4 | packQuaternionXYZPositionBit (quat const &q) |
| quat | unpackQuaternionXYZPositionBit (float4 const &packed) |
| using Foundation::Math::float2 = typedef vec2 |
| using Foundation::Math::float3 = typedef vec3 |
| using Foundation::Math::float4 = typedef vec4 |
| using Foundation::Math::float4x4 = typedef mat4 |
| using Foundation::Math::int2 = typedef ivec2 |
| using Foundation::Math::int3 = typedef ivec3 |
| using Foundation::Math::int4 = typedef ivec4 |
| using Foundation::Math::uint = typedef unsigned int |
| using Foundation::Math::uint2 = typedef uvec2 |
| using Foundation::Math::uint3 = typedef uvec3 |
| using Foundation::Math::uint4 = typedef uvec4 |
|
inline |
Row-major. glm decompose fails to solve this one's perspective component correctly (FIXME in its docs). 0.0014 0 0 0 0 0 0.0014 0 0 -0.0014 0 0 2 0 2 1 Hence the implementation for only the TRS components. Assumes the matrix is affine.
| float Foundation::Math::dequantizeFP16 | ( | uint16_t | h | ) |
Reverse quantization of a half-precision (as defined by IEEE-754 fp16) floating point value Preserves Inf/NaN, flushes denormals to zero
| float Foundation::Math::dequantizeFP16 | ( | unsigned short | h | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| uint16_t Foundation::Math::quantizeFP16 | ( | float | v | ) |
Quantize a float into half-precision (as defined by IEEE-754 fp16) floating point value Generates +-inf for overflow, preserves NaN, flushes denormals to zero, rounds to nearest Representable magnitude range: [6e-5; 65504] Maximum relative reconstruction error: 5e-4
| float Foundation::Math::quantizeFP32 | ( | float | v, |
| int | N | ||
| ) |
| float Foundation::Math::quantizeFP32 | ( | float | v, |
| int32_t | N | ||
| ) |
Quantize a float into a floating point value with a limited number of significant mantissa bits, preserving the IEEE-754 fp32 binary representation Generates +-inf for overflow, preserves NaN, flushes denormals to zero, rounds to nearest Assumes N is in a valid mantissa precision range, which is 1..23
|
inline |
[-1, 1] range -> [-(1<< (Nbits - 1)) - 1, (1 << (Nbits - 1))] \in N e.g. Nbits = 10 -> [-511, 512] In transport you may want to add 1 << (Nbits - 1) to the quantized value to shift it to [0, 1 << NBits) range since you'd be packing complement int32 bits - truncation would result in a loss of precision To do this, use QuantizeSnormShifted and DequantizeSnormShifted
|
inline |
|
inline |
|
inline |
|
inline |