Skip to content

Commit

Permalink
Fix hue shifting when using SDR Gamma Boost
Browse files Browse the repository at this point in the history
  • Loading branch information
audaki committed Oct 19, 2024
1 parent 3245b93 commit dbf089b
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 = sign(fLuma) * pow(abs(fLuma), input.color.y);
hdr_color.rgb = hdr_color.rgb * (fLumaWithGamma / fLuma);
}
}

Expand Down

0 comments on commit dbf089b

Please sign in to comment.