Skip to content

HDR: no more rainbow colours with the sharpness at 0 - #166

Closed
RootChad wants to merge 1 commit into
mainfrom
hdr-present
Closed

RootChad wants to merge 1 commit into
mainfrom
hdr-present

Conversation

@RootChad

Copy link
Copy Markdown
Collaborator

The bug

With HDR on, the picture came out in rainbow colours unless the Sharpness was above 0 (Discord: "HDR is broken" in #issues, and in #general: "with HDR on I need the sharpness on or it goes rainbow").

Why

When the game is told the display is HDR, it makes its window textures RGB10A2 at the same memory as its RGBA8 ones. texture_for_present can then return the image made for the RGBA8 description; the log shows its image is format 37, the picture 64.

  • With the sharpness at 0 and the window scaling filter off, the picture was blitted. A blit reads an image by the image's own format, so the RGB10A2 picture was read as RGBA8, which gives rainbow colours.
  • With the sharpness on, it went through the scaling pass (fg_scale), which samples the picture's own view, so the colours were right.

The fix

When the picture is RGB10A2 and its image is another format, it goes through the scaling pass's sampled copy (framegen_scale forced; a plain copy when the filter and the sharpness are off), and the log says so once.

  • Only for an RGB10A2 picture. An RGBA8 image of an RGBA8_SRGB picture blits right as it is, and its sRGB view would darken it.
  • HDR players with the sharpness on already went through this pass: nothing changes for them.
  • SDR is untouched: the condition never holds there.

Tested (RX 6600 XT, the game's HDR picture in an SDR window with HOS_HDR=1)

before after
HDR picture, sharpness 0, filter off rainbow right colours (grey and washed out, as an HDR picture on an SDR screen)
HDR picture, sharpness 40% right right
SDR, sharpness 0 right right; the fix never triggers (0 log lines)

Not verified

  • On a real HDR display: the test PC's surface lists no HDR10 format.
  • On NVIDIA, or with DLSS and frame generation on, as in the RTX 5080 report. That report may have another cause on top of this one.
  • The screenshot and the item wheel's backdrop also blit the window texture, and may show the same wrong colours in HDR. They are left as they are.

🤖 Generated with Claude Code

…pness at 0

The game told the display is HDR makes its window textures RGB10A2 at the memory of its RGBA8 ones, and the image found
for the picture can be the one made for the RGBA8 description (texture_for_present). With the sharpness at 0 and the
window scaling filter off, the picture was blitted, and a blit reads an image by its own format: the RGB10A2 picture read
as RGBA8 came out in rainbow colours (Discord: "HDR is broken", "with HDR on I need the sharpness on or it goes rainbow").
With the sharpness on it went through the scaling pass, which samples the picture's own view, and was right.

When the picture is RGB10A2 and its image is another format, it now goes through that pass's sampled copy (framegen_scale
forced, a plain copy when the filter and the sharpness are off), and the log says so once. Other pairs are left as they
are: an RGBA8 image of an RGBA8_SRGB picture blits right, and its sRGB view would darken it.

Seen and checked on an RX 6600 XT with HOS_HDR=1 (the game's HDR picture in an SDR window).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pixl27

pixl27 commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Merged into 0.7.9.3 (https://github.com/pixl27/ProjectReLink/releases/tag/v0.7.9.3), through the hotfix branch rather than this pull request, with your authorship kept in the commit (Co-authored-by). Thank you, RootChad.

@pixl27 pixl27 closed this Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants