Skip to content

HDR10 Color Conversion in lovr.math #963

Description

@bjornbytes

In HDR mode, if you want to use lovr.graphics.setBackgroundColor, or Pass:setColor, or send a color to a shader, and you want to use an sRGB color, there's no easy way to convert that to Rec2020. Once you're in a shader, you can use rec2020ToSRGB / sRGBToRec2020, but this doesn't work for the background color.

lovr.math already has srgb <-> linear conversions, so it would make sense to add similar conversions for srgb <-> rec2020. A helper for encoding/decoding the PQ transfer function would be nice too.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions