rendervulkan: Fix HDR heatmap with mura (off by a gamma 2.2)

This commit is contained in:
Joshua Ashton 2023-10-25 07:30:39 +01:00
parent 51bd7d03d1
commit 59c1571e34
2 changed files with 20 additions and 26 deletions

View file

@ -82,16 +82,16 @@ vec3 apply_layer_color_mgmt(vec3 color, uint layer, uint colorspace) {
colorspace = colorspace_pq;
}
// Shaper + 3D LUT path to match DRM.
uint plane_eotf = colorspace_to_eotf(colorspace);
if (layer == 0 && checkDebugFlag(compositedebug_Heatmap))
{
// Debug HDR heatmap.
color = hdr_heatmap(color, colorspace);
plane_eotf = EOTF_Gamma22;
}
else
{
// Shaper + 3D LUT path to match DRM.
uint plane_eotf = colorspace_to_eotf(colorspace);
// The shaper TF is basically just a regamma to get into something the shaper LUT can handle.
//
@ -109,7 +109,6 @@ vec3 apply_layer_color_mgmt(vec3 color, uint layer, uint colorspace) {
color = perform_3dlut(color, s_lut3D[plane_eotf]);
}
color = colorspace_blend_tf(color, c_output_eotf);
}
return color;
}

View file

@ -220,10 +220,5 @@ vec3 hdr_heatmap(vec3 inputColor, uint colorspace)
else
outputColor = hdr_heatmap_lilium_impl(xyz.y); // Lilium Heatmap
// Brighten the heatmap up to something reasonable.
// If we care enough we could use some setting here someday.
if (c_output_eotf == EOTF_PQ)
outputColor *= 400.0f / 80.0f; // 400 nit as scRGB TF for blend space.
return outputColor;
}