Show the clipping overlay's per-channel colours and follow the sliders.
The overlay had been collapsed to a single highlight bit, so every warning was white. It now reads the finished frame per channel again: red for one clipped channel, yellow for two, white for all three, and it updates as Exposure or Recovery moves, which is what holding Ctrl is for. The render check renders the overlay and asserts both the colours and that +6 EV turns a clear band white. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
+13
-27
@@ -547,17 +547,7 @@ void main(){
|
||||
}
|
||||
}
|
||||
|
||||
// Alpha carries the *source* clipping state to the finish pass, so the
|
||||
// warning reflects the pixels the sensor/proxy had, not the graded result.
|
||||
// It is a 4-bit code in sixteenths: bit 0/1/2 = red/green/blue clipped and
|
||||
// bit 3 = shadow clipped, so the overlay can still name the channels instead
|
||||
// of collapsing every highlight warning to white.
|
||||
float clipCode = 0.0;
|
||||
if (src.r >= 0.996) clipCode += 1.0;
|
||||
if (src.g >= 0.996) clipCode += 2.0;
|
||||
if (src.b >= 0.996) clipCode += 4.0;
|
||||
if (min(src.r, min(src.g, src.b)) <= 0.004) clipCode += 8.0;
|
||||
outColor = vec4(clamp(srgb, 0.0, 1.0), clipCode / 16.0);
|
||||
outColor = vec4(clamp(srgb, 0.0, 1.0), 1.0);
|
||||
}`;
|
||||
|
||||
const BLUR_FRAG = `#version 300 es
|
||||
@@ -861,28 +851,24 @@ void main(){
|
||||
vec3 finalCol = clamp(col, 0.0, 1.0);
|
||||
// Clipping overlay: which channels have run out of headroom. Red/green/blue
|
||||
// mean one channel clipped, yellow means two, white means all three — the
|
||||
// same reading Aperture's exposure warnings gave while you dragged.
|
||||
// The grade pass wrote the untouched source's clipping state into alpha as a
|
||||
// 4-bit code in sixteenths, so warning about the source still tells the truth
|
||||
// after a curve or a shadow lift and the channels are still known here.
|
||||
int clipCode = int(texture(u_graded, v_uv).a * 16.0 + 0.5);
|
||||
bool clipR = (clipCode & 1) != 0;
|
||||
bool clipG = (clipCode & 2) != 0;
|
||||
bool clipB = (clipCode & 4) != 0;
|
||||
bool clipShadow = (clipCode & 8) != 0;
|
||||
// same reading Aperture's exposure warnings gave while you dragged. It reads
|
||||
// the finished frame rather than the source, so holding Ctrl while moving
|
||||
// Exposure or Recovery shows the warnings appear and clear as you go.
|
||||
if (u_clip > 1.5) {
|
||||
// Shadow clipping: everything that has fallen to the bottom of the range.
|
||||
if (clipShadow) finalCol = vec3(0.15, 0.4, 1.0);
|
||||
if (max(finalCol.r, max(finalCol.g, finalCol.b)) < 0.02) {
|
||||
finalCol = vec3(0.15, 0.4, 1.0);
|
||||
}
|
||||
} else if (u_clip > 0.5) {
|
||||
float n = float(clipR) + float(clipG) + float(clipB);
|
||||
vec3 k = step(0.985, finalCol);
|
||||
float n = k.r + k.g + k.b;
|
||||
if (n > 0.5) {
|
||||
vec3 mark = vec3(1.0);
|
||||
if (n < 1.5) {
|
||||
if (clipR) mark = vec3(1.0, 0.12, 0.12);
|
||||
else if (clipG) mark = vec3(0.1, 1.0, 0.2);
|
||||
if (n < 2.5) {
|
||||
if (n > 1.5) mark = vec3(1.0, 0.9, 0.1);
|
||||
else if (k.r > 0.5) mark = vec3(1.0, 0.12, 0.12);
|
||||
else if (k.g > 0.5) mark = vec3(0.1, 1.0, 0.2);
|
||||
else mark = vec3(0.15, 0.4, 1.0);
|
||||
} else if (n < 2.5) {
|
||||
mark = vec3(1.0, 0.9, 0.1);
|
||||
}
|
||||
finalCol = mark;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user