Skip to content

Ensure that bevy_color works with HDR #12089

@eero-lehtinen

Description

@eero-lehtinen

What problem does this solve or what need does it fill?

Currently bevy_color stresses everywhere in its documentation that values should be contained in [0.0, 1.0]. This assumption is incorrect when working with HDR values.

There is also no simple way to construct HDR values from SDR values. Before it could be done with Color::RED * 5.0 (I'm not sure if this is correct but I'm doing it this way).

What solution would you like?

We could update documentation with all color spaces to include HDR values. Then make sure that all color functions support these extended values. E.g. adjust_luminance currently does explicit clamping which is broken with HDR.

Supporting straight up multiplications for constructing HDR values seems error prone, but some kind of function for this would be convenient.

What alternative(s) have you considered?

We could also do a separate HDR color type. Not sure how that would work with our current color spaces.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ColorColor spaces and color mathA-RenderingDrawing game state to the screenC-BugAn unexpected or incorrect behaviorC-DocsAn addition or correction to our documentationC-UsabilityA targeted quality-of-life change that makes Bevy easier to use

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions