Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bradgrantham-lunarg opened this issue Oct 7, 2024 · 0 comments
Labels
P2 A high-priority code maintenance issue or a functional problem that is recoverable or not a crash. replay Issue with replay (capture was successful)

Comments

@bradgrantham-lunarg
Copy link
Contributor

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 bradgrantham-lunarg added P2 A high-priority code maintenance issue or a functional problem that is recoverable or not a crash. replay Issue with replay (capture was successful) labels Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 A high-priority code maintenance issue or a functional problem that is recoverable or not a crash. replay Issue with replay (capture was successful)
Projects
None yet
Development

No branches or pull requests

1 participant