Skip to content

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

Open
@bradgrantham-lunarg

Description

@bradgrantham-lunarg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A high-priority code maintenance issue or a functional problem that is recoverable or not a crash.replayIssue with replay (capture was successful)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions