Skip to content

Commit 4057a51

Browse files
Automated Update
1 parent 37c9f51 commit 4057a51

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

portable_config/shaders/hdr-toys/tone-mapping/bt2446c.glsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ vec4 hook() {
178178
const float Lmax = RGB_to_Lab(vec3(1000.0 / reference_white)).x;
179179

180180
color.rgb = RGB_to_Lab(color.rgb);
181-
color.rgb = Lab_to_LCH(color.rgb);
181+
color.rgb = Lab_to_LCh(color.rgb);
182182
color.y *= chroma_correction(color.x, Lref, Lmax, sigma);
183-
color.rgb = LCH_to_Lab(color.rgb);
183+
color.rgb = LCh_to_Lab(color.rgb);
184184
color.rgb = Lab_to_RGB(color.rgb);
185185

186186
return color;

portable_config/shaders/hdr-toys/tone-mapping/false.glsl

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,13 @@ vec4 hook() {
157157
vec3 c0 = vec3(0.20104, 0.16, radians(350.0));
158158
vec3 cb = vec3(0.13040, 0.08, radians(350.0));
159159

160-
if (y > l5) color.rgb = Lab_to_RGB(LCH_to_Lab(cw));
161-
else if (y > l4) color.rgb = Lab_to_RGB(LCH_to_Lab(mix(c4, c5, l(y, l4, l5))));
162-
else if (y > l3) color.rgb = Lab_to_RGB(LCH_to_Lab(mix(c3, c4, l(y, l3, l4))));
163-
else if (y > l2) color.rgb = Lab_to_RGB(LCH_to_Lab(mix(c2, c3, l(y, l2, l3))));
164-
else if (y > l1) color.rgb = Lab_to_RGB(LCH_to_Lab(mix(c1, c2, l(y, l1, l2))));
160+
if (y > l5) color.rgb = Lab_to_RGB(LCh_to_Lab(cw));
161+
else if (y > l4) color.rgb = Lab_to_RGB(LCh_to_Lab(mix(c4, c5, l(y, l4, l5))));
162+
else if (y > l3) color.rgb = Lab_to_RGB(LCh_to_Lab(mix(c3, c4, l(y, l3, l4))));
163+
else if (y > l2) color.rgb = Lab_to_RGB(LCh_to_Lab(mix(c2, c3, l(y, l2, l3))));
164+
else if (y > l1) color.rgb = Lab_to_RGB(LCh_to_Lab(mix(c1, c2, l(y, l1, l2))));
165165
else if (y > l0) color.rgb = vec3(l(y, l0, l1));
166-
else color.rgb = Lab_to_RGB(LCH_to_Lab(mix(cb, c0, l(y, lb, l0))));
166+
else color.rgb = Lab_to_RGB(LCh_to_Lab(mix(cb, c0, l(y, lb, l0))));
167167

168168
return color;
169169
}
@@ -302,24 +302,24 @@ vec4 hook() {
302302

303303
float stops = log2(max(RGB_to_XYZ(color.rgb).y, 1e-6) / 0.18);
304304

305-
if (stops >= 7.5) color.rgb = Lab_to_RGB(LCH_to_Lab(vec3(0.99500, 0.00, radians(000.0))));
306-
else if (stops >= 6.5) color.rgb = Lab_to_RGB(LCH_to_Lab(vec3(0.94659, 0.11, radians(005.0))));
307-
else if (stops >= 5.5) color.rgb = Lab_to_RGB(LCH_to_Lab(vec3(0.89269, 0.22, radians(015.0))));
308-
else if (stops >= 4.5) color.rgb = Lab_to_RGB(LCH_to_Lab(vec3(0.83878, 0.33, radians(025.0))));
309-
else if (stops >= 3.5) color.rgb = Lab_to_RGB(LCH_to_Lab(vec3(0.78487, 0.11, radians(060.0))));
310-
else if (stops >= 2.5) color.rgb = Lab_to_RGB(LCH_to_Lab(vec3(0.73097, 0.33, radians(090.0))));
311-
else if (stops >= 1.5) color.rgb = Lab_to_RGB(LCH_to_Lab(vec3(0.67706, 0.22, radians(105.0))));
312-
else if (stops >= 0.5) color.rgb = Lab_to_RGB(LCH_to_Lab(vec3(0.62315, 0.11, radians(120.0))));
313-
else if (stops >= -0.5) color.rgb = Lab_to_RGB(LCH_to_Lab(vec3(0.56925, 0.00, radians(000.0))));
314-
else if (stops >= -1.5) color.rgb = Lab_to_RGB(LCH_to_Lab(vec3(0.52324, 0.33, radians(130.0))));
315-
else if (stops >= -2.5) color.rgb = Lab_to_RGB(LCH_to_Lab(vec3(0.47724, 0.22, radians(145.0))));
316-
else if (stops >= -3.5) color.rgb = Lab_to_RGB(LCH_to_Lab(vec3(0.43123, 0.11, radians(160.0))));
317-
else if (stops >= -4.5) color.rgb = Lab_to_RGB(LCH_to_Lab(vec3(0.38523, 0.32, radians(220.0))));
318-
else if (stops >= -5.5) color.rgb = Lab_to_RGB(LCH_to_Lab(vec3(0.33922, 0.24, radians(245.0))));
319-
else if (stops >= -6.5) color.rgb = Lab_to_RGB(LCH_to_Lab(vec3(0.29322, 0.24, radians(290.0))));
320-
else if (stops >= -7.5) color.rgb = Lab_to_RGB(LCH_to_Lab(vec3(0.24721, 0.16, radians(320.0))));
321-
else if (stops >= -8.5) color.rgb = Lab_to_RGB(LCH_to_Lab(vec3(0.20104, 0.08, radians(350.0))));
322-
else color.rgb = Lab_to_RGB(LCH_to_Lab(vec3(0.13040, 0.00, radians(000.0))));
305+
if (stops >= 7.5) color.rgb = Lab_to_RGB(LCh_to_Lab(vec3(0.99500, 0.00, radians(000.0))));
306+
else if (stops >= 6.5) color.rgb = Lab_to_RGB(LCh_to_Lab(vec3(0.94659, 0.11, radians(005.0))));
307+
else if (stops >= 5.5) color.rgb = Lab_to_RGB(LCh_to_Lab(vec3(0.89269, 0.22, radians(015.0))));
308+
else if (stops >= 4.5) color.rgb = Lab_to_RGB(LCh_to_Lab(vec3(0.83878, 0.33, radians(025.0))));
309+
else if (stops >= 3.5) color.rgb = Lab_to_RGB(LCh_to_Lab(vec3(0.78487, 0.11, radians(060.0))));
310+
else if (stops >= 2.5) color.rgb = Lab_to_RGB(LCh_to_Lab(vec3(0.73097, 0.33, radians(090.0))));
311+
else if (stops >= 1.5) color.rgb = Lab_to_RGB(LCh_to_Lab(vec3(0.67706, 0.22, radians(105.0))));
312+
else if (stops >= 0.5) color.rgb = Lab_to_RGB(LCh_to_Lab(vec3(0.62315, 0.11, radians(120.0))));
313+
else if (stops >= -0.5) color.rgb = Lab_to_RGB(LCh_to_Lab(vec3(0.56925, 0.00, radians(000.0))));
314+
else if (stops >= -1.5) color.rgb = Lab_to_RGB(LCh_to_Lab(vec3(0.52324, 0.33, radians(130.0))));
315+
else if (stops >= -2.5) color.rgb = Lab_to_RGB(LCh_to_Lab(vec3(0.47724, 0.22, radians(145.0))));
316+
else if (stops >= -3.5) color.rgb = Lab_to_RGB(LCh_to_Lab(vec3(0.43123, 0.11, radians(160.0))));
317+
else if (stops >= -4.5) color.rgb = Lab_to_RGB(LCh_to_Lab(vec3(0.38523, 0.32, radians(220.0))));
318+
else if (stops >= -5.5) color.rgb = Lab_to_RGB(LCh_to_Lab(vec3(0.33922, 0.24, radians(245.0))));
319+
else if (stops >= -6.5) color.rgb = Lab_to_RGB(LCh_to_Lab(vec3(0.29322, 0.24, radians(290.0))));
320+
else if (stops >= -7.5) color.rgb = Lab_to_RGB(LCh_to_Lab(vec3(0.24721, 0.16, radians(320.0))));
321+
else if (stops >= -8.5) color.rgb = Lab_to_RGB(LCh_to_Lab(vec3(0.20104, 0.08, radians(350.0))));
322+
else color.rgb = Lab_to_RGB(LCh_to_Lab(vec3(0.13040, 0.00, radians(000.0))));
323323

324324
return color;
325325
}

0 commit comments

Comments
 (0)