Skip to content

Commit

Permalink
Fix gamut visualizers
Browse files Browse the repository at this point in the history
  • Loading branch information
audaki committed Apr 18, 2024
1 parent 07c7105 commit 9da3001
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions resource/shaders/HDR/basic_hdr_shader_ps.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -478,13 +478,12 @@ float4 main (PS_INPUT input) : SV_TARGET
{
int cs = visualFunc.x - VISUALIZE_REC709_GAMUT;

float3 r = SK_Color_xyY_from_RGB ( _ColorSpaces [cs], float3 (1.f, 0.f, 0.f) ),
g = SK_Color_xyY_from_RGB ( _ColorSpaces [cs], float3 (0.f, 1.f, 0.f) ),
b = SK_Color_xyY_from_RGB ( _ColorSpaces [cs], float3 (0.f, 0.f, 1.f) ),
w = SK_Color_xyY_from_RGB ( _ColorSpaces [cs], float3 (D65, hdrLuminance_MaxLocal / 80.0) );
float3 r = float3(_ColorSpaces[cs].xr, _ColorSpaces[cs].yr, 0),
g = float3(_ColorSpaces[cs].xg, _ColorSpaces[cs].yg, 0),
b = float3(_ColorSpaces[cs].xb, _ColorSpaces[cs].yb, 0);

float3 vColor_xyY =
SK_Color_xyY_from_RGB ( _ColorSpaces [cs], normalize (hdr_color.rgb) );
float3 hdr_XYZ = sRGBtoXYZ(hdr_color.rgb);
float3 vColor_xyY = float3(hdr_XYZ.x / (hdr_XYZ.x + hdr_XYZ.y + hdr_XYZ.z), hdr_XYZ.y / (hdr_XYZ.x + hdr_XYZ.y + hdr_XYZ.z), 0);

float3 vTriangle [] = {
r, g, b
Expand Down Expand Up @@ -876,4 +875,4 @@ float4 main (PS_INPUT input) : SV_TARGET

return
FinalOutput (color_out);
}
}

0 comments on commit 9da3001

Please sign in to comment.