Skip to content

Commit

Permalink
Remove unneeded sign() and abs() calls for Luma
Browse files Browse the repository at this point in the history
  • Loading branch information
audaki committed Oct 19, 2024
1 parent dbf089b commit 71e23c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resource/shaders/HDR/basic_hdr_shader_ps.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ main (PS_INPUT input) : SV_TARGET
if (input.color.y != 1.0f)
{
float fLuma = Luminance(hdr_color.rgb);
float fLumaWithGamma = sign(fLuma) * pow(abs(fLuma), input.color.y);
float fLumaWithGamma = pow(fLuma, input.color.y);
hdr_color.rgb = hdr_color.rgb * (fLumaWithGamma / fLuma);
}
}
Expand Down

0 comments on commit 71e23c8

Please sign in to comment.