gfxreconstruct
gfxreconstruct copied to clipboard
Math converting pixels in framework/util/image_writer.cpp is incorrect
So that the range [0.0f,1.0f]
is evenly distributed among uint8_t
values, all use of / 255.0f
should be / std::nextafter(256.0f, 0.0f)
(which will equate to 255.99...f).
DXGI FLOAT
and Vulkan UFLOAT
and SFLOAT
aren't normalized, so source values should be clamped to [0.0f, 1.0f]
. Otherwise float values that exceed the range [0, 1] will probably look like noise and maybe a colorful rainbow.
For true representation of non-normalized floating-point components, it may be valuable to support an HDR image format for screenshots and for dump-resources like .hdr
(Radiance HDR) format.