I understand that HDR files are images encoded with a higher precision in order to keep more details.
When loading such images in real-time rendering applications using common Graphics APIs (DirectX, OpenGL, Vulkan), which are the "HDR texture formats" that ensure details will be preserved?
-
$\begingroup$ Are you talking about the texel formats the GPU understands, or are you talking about the file formats that images are stored in before texture upload? $\endgroup$– Dan HulmeNov 6, 2018 at 9:20
-
$\begingroup$ About the former $\endgroup$– wipNov 6, 2018 at 13:03
-
$\begingroup$ But connecting those with details about how the data is arranged in the image files would be interesting as well Dan. $\endgroup$– wipNov 6, 2018 at 13:05
2 Answers
In general, using floating point textures will help preserve HDR values. They can be 16-bit or 32-bit floats for the color channels, usually. In OpenGL you could choose the type to be GL_FLOAT
for 32-bits per channel or GL_HALF_FLOAT
for 16-bits per channel. In my experience, for image processing, 16-bits is usually enough and is half as much data.
Also consider these alternatives for reducing bandwidth in comparison to R16G16B16A16.
DXGI_FORMAT_BC6H_UF16 is block compressed fp16 (half) RGB.
https://docs.microsoft.com/en-us/windows/desktop/direct3d11/bc6h-format
DXGI_FORMAT_R11G11B10 unsigned small float
https://bartwronski.com/2017/04/02/small-float-formats-r11g11b10f-precision/
Common image file formats for HDR are exrs or dds. They're pretty trivially encoded as 32-bit or 16-bit per channel floats.
-
$\begingroup$ Thanks for the complementary info and for the link to an interesting blog post $\endgroup$– wipNov 18, 2018 at 23:11