rendervulkan: Fix HDR heatmap with mura (off by a gamma 2.2)
This commit is contained in:
parent
51bd7d03d1
commit
59c1571e34
2 changed files with 20 additions and 26 deletions
|
@ -82,34 +82,33 @@ 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
|
||||
|
||||
|
||||
// The shaper TF is basically just a regamma to get into something the shaper LUT can handle.
|
||||
//
|
||||
// Despite naming, degamma + shaper TF are NOT necessarily the inverse of each other. ^^^
|
||||
// This gets the color ready to go into the shaper LUT.
|
||||
// ie. scRGB -> PQ
|
||||
//
|
||||
// We also need to do degamma here for non-linear views to blend in linear space.
|
||||
// ie. PQ -> PQ would need us to manually do bilinear here.
|
||||
bool lut3d_enabled = textureQueryLevels(s_shaperLut[plane_eotf]) != 0;
|
||||
if (lut3d_enabled)
|
||||
{
|
||||
// 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.
|
||||
//
|
||||
// Despite naming, degamma + shaper TF are NOT necessarily the inverse of each other. ^^^
|
||||
// This gets the color ready to go into the shaper LUT.
|
||||
// ie. scRGB -> PQ
|
||||
//
|
||||
// We also need to do degamma here for non-linear views to blend in linear space.
|
||||
// ie. PQ -> PQ would need us to manually do bilinear here.
|
||||
bool lut3d_enabled = textureQueryLevels(s_shaperLut[plane_eotf]) != 0;
|
||||
if (lut3d_enabled)
|
||||
{
|
||||
color = colorspace_plane_shaper_tf(color, colorspace);
|
||||
color = perform_1dlut(color, s_shaperLut[plane_eotf]);
|
||||
color = perform_3dlut(color, s_lut3D[plane_eotf]);
|
||||
}
|
||||
color = colorspace_blend_tf(color, c_output_eotf);
|
||||
color = colorspace_plane_shaper_tf(color, colorspace);
|
||||
color = perform_1dlut(color, s_shaperLut[plane_eotf]);
|
||||
color = perform_3dlut(color, s_lut3D[plane_eotf]);
|
||||
}
|
||||
color = colorspace_blend_tf(color, c_output_eotf);
|
||||
|
||||
return color;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue