Skip to content

Commit

Permalink
[PATHFINDER2] Add bt2020 clamp to tonemapper.hlsl
Browse files Browse the repository at this point in the history
  • Loading branch information
marat569 committed Nov 12, 2024
1 parent 206c014 commit c89f789
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/games/pathfinder2wotr/final_0x20133A8B.ps_4_0.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ void main(
out float4 o0 : SV_Target0) {
o0.xyzw = BlitTexture.Sample(BlitSampler_s, v0.xy).xyzw;

o0.rgb = renodx::color::correct::GammaSafe(o0.rgb); // The entire game is Linear, so we don't need pow 2.2 here
o0.rgb = renodx::color::correct::GammaSafe(o0.rgb); // The entire game is Linear, so we don't need pow 2.2 here

o0.rgb *= injectedData.toneMapGameNits / 80.f;

// o0.rgb = renodx::color::bt709::clamp::BT2020(o0.rgb);

return;
}
3 changes: 2 additions & 1 deletion src/games/pathfinder2wotr/tonemapper.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ float3 applyUserTonemap(float3 untonemapped, Texture2D lutTexture, SamplerState
0.f); // hue correction, might not need it [yet]
}

outputColor = renodx::color::bt709::clamp::AP1(outputColor); // Clamp to AP1 to avoid negative colors
// outputColor = renodx::color::bt709::clamp::AP1(outputColor); // Clamp to AP1 to avoid negative colors
outputColor = renodx::color::bt709::clamp::BT2020(outputColor); // Clamp to BT2020 to avoid negative colors

return outputColor;
}

0 comments on commit c89f789

Please sign in to comment.