Skip to content

Commit

Permalink
[color_helpers]: do not do color remapping for PQ source content
Browse files Browse the repository at this point in the history
Fixes a bug where HDR colors were not being rendered faithfully at the edges of the color gamut.

Thanks to JDSP for reporting.
  • Loading branch information
jeremyselan committed Jan 12, 2024
1 parent 7fcfbf0 commit 52c8cd7
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions src/color_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -866,24 +866,12 @@ void buildPQColorimetry( displaycolorimetry_t * pColorimetry, colormapping_t *pM
{
*pColorimetry = displaycolorimetry_2020;

if ( BIsWideGamut( nativeDisplayOutput) )
{
colormapping_t smoothRemap;
smoothRemap.blendEnableMinSat = 0.7f;
smoothRemap.blendEnableMaxSat = 1.0f;
smoothRemap.blendAmountMin = 0.0f;
smoothRemap.blendAmountMax = 1.f;
*pMapping = smoothRemap;
}
else
{
colormapping_t noRemap;
noRemap.blendEnableMinSat = 0.7f;
noRemap.blendEnableMaxSat = 1.0f;
noRemap.blendAmountMin = 0.0f;
noRemap.blendAmountMax = 0.0f;
*pMapping = noRemap;
}
colormapping_t noRemap;
noRemap.blendEnableMinSat = 0.0f;
noRemap.blendEnableMaxSat = 1.0f;
noRemap.blendAmountMin = 0.0f;
noRemap.blendAmountMax = 0.0f;
*pMapping = noRemap;
}

bool approxEqual( const glm::vec3 & a, const glm::vec3 & b, float flTolerance = 1e-5f )
Expand Down

0 comments on commit 52c8cd7

Please sign in to comment.