Dogway's grading shader (slang)

@Chthon, Hey, sorry for taking so long but don’t have much time lately.

Very interesting post. Your findings align with mine at the time, for instance these are the phosphors in Grade for the Japanese NTSC:

const mat3 P22_J_ph = mat3(
     0.625, 0.280, 0.152,
     0.350, 0.605, 0.062,
     0.025, 0.115, 0.786);

I used a per phosphor IQM from various sources (listed in the file), so I’m surprised it aligns so well with your sources. Now it’s a matter of deciding if we want 0.340 green for red or 0.350, since that’s the biggest delta.

Would you mind explaining what’s going on in the last stanza of your EOTF function (“Black lift compensation”)?

IIRC, it was a regression. The function itself doesn’t have a gamma, as the gamma (in the function) depends from the black level, what I did was to remap it (EOTF black level) to Grade’s Black Lift, so you get 2.40 gamma at 0.1 and 2.6 gamma at 0.0.

About the “Black lift compensation” block, I think my mindset was to first take ‘bl’ into space, undo the lift, then restore the gamma lost by manipulating the lift. As I noted I did this upon regressions so nothing else gets affected. I remember this to be painful and was one of the last bits I integrated.