gfxreconstruct icon indicating copy to clipboard operation
gfxreconstruct copied to clipboard

Math converting pixels in framework/util/image_writer.cpp is incorrect

Open bradgrantham-lunarg opened this issue 4 months ago • 0 comments

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.

bradgrantham-lunarg avatar Oct 07 '24 23:10 bradgrantham-lunarg