Hi @MajorPainTheCactus, thanks for the answer. I tried your suggestions but the darkest value remains cropped.
I’ll explain a bit what I’ve tested and what I expected versus what I’m getting.
I’ve been testing everything in SDR mode with your SDR shaders.
The Gray Ramp test in SNES 240p test suite has a number of bars, of which the most left is black (RGB 0,0,0) and the bar second to left starts with darkest grey (RGB 8,8,8) and then increments the bars at about RGB steps of 8,8,8 (so third bar is 16,16,16, etc).
On a CRT with RGB/SCART connection that has properly set brightness and contrast, ALL the dark bars are visible, starting with the second to left bar (RGB 8,8,8). This is assuming watching in a dimly lit room.
In below picture I highlighted the bar that is cropped to black in your shader, it’s the second bar with RGB value 8,8,8.

I’ve noticed that in some cases your shader is cropping more dark color bars, so then even the third and fourth bars (16,16,16 and 24,24,24) are cropped to black. Note that they’re really cropped (clamped?) to RGB 0,0,0.
If and when you have some time you could do the following:
-
run the SNES 240p Gray Ramp test WITHOUT shader, then make sure you calibrate your monitor such that you can see all dark bars including the RGB 8,8,8 one.
-
Then apply one of your shader presets an you’ll see the darkest bars getting cropped.
You can bind keys to “previous shader” and “next shader” (I think default are “N” and “M”). If you have an empty shader next to your preset, you can switch back and forth between the non-shaded and shaded output. Very helpful for seeing the difference, what’s being different and whether the shader output is gamma neutral.
In this regard I noticed that changing between “SDR: Display Color Space: 709 | SRGB | DCI-P3” makes a large difference in the amount of dark bars cropped.
Looking at your code I see you’re applying different gamma values here, but note that changing gamma by approx 0.2 shouldn’t result in cropping the darkest bars to black (it could make them at best a bit darker, but not crop them to black).
Thanks again for the marvelous work on the shader, apart from this dark bar(s) cropping everything is great!