Skip to content

Commit

Permalink
Fix hue shifting when using SDR Gamma Boost (SpecialKO#217)
Browse files Browse the repository at this point in the history
* Fix hue shifting when using SDR Gamma Boost
* Remove unneeded sign() and abs() calls for Luma
  • Loading branch information
audaki authored Oct 19, 2024
1 parent 63a8325 commit 50ff5e5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions resource/shaders/HDR/basic_hdr_shader_ps.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,9 @@ main (PS_INPUT input) : SV_TARGET
{
if (input.color.y != 1.0f)
{
hdr_color.rgb = sign (hdr_color.rgb) *
pow (abs (hdr_color.rgb),
input.color.yyy);
float fLuma = Luminance(hdr_color.rgb);
float fLumaWithGamma = pow(fLuma, input.color.y);
hdr_color.rgb = hdr_color.rgb * (fLumaWithGamma / fLuma);
}
}

Expand Down

0 comments on commit 50ff5e5

Please sign in to comment.