Exact UNORM8 to Float
3 days ago
- #Floating-Point Conversion
- #GPU Computing
- #UNORM Format
- UNORM8 to float conversion can be exact by dividing by 255 using proper arithmetic, though GPUs often avoid exact conversion due to perceived cost.
- A common practical approximation multiplies by the float32 reciprocal of 255, which is sufficient for most uses but not exact.
- Exact conversion without doubles involves methods like using constants from a geometric series or multiplying by 3 then dividing by 765.
- Alternative exact methods include combining integer operations with precise constants or using bit manipulations.
- Exact conversions for SNORM formats also exist using specific integer multipliers and divisors.