I’ll check it out when I wake back up, gamma rework for all spaces right?
Yes, I’m honoring more the analogue gamma, so the gamma delta is against itself and not the display gamma. Then you go from linear to display gamma of your type.
I revised the rolled_gain code and it was clipping some. So I remade it entirely and now it works fine, shorter, and better overall.
I also observed that the default D65 temperature is slightly blue, so it was by default making the image cooler. Now it defaults to D55 which is more or less more neutral to source.
By the way, I reverted the gamma pipeline rework, it’s better to compare to linear and not to SMPTE-C as I found out by some tests. Also since it’s content based, linear transform is sRGB based, not EOTF based.
Wow, lots of changes since I last dropped by! I didn’t get any clipping when using NTSC-J settings with a white point of 6505K with the old version, but I’m getting some clipping with the recent changes. Is this expected?
shaders = "10"
shader0 = "../shaders_slang/stock.slang"
filter_linear0 = "false"
wrap_mode0 = "clamp_to_border"
mipmap_input0 = "false"
alias0 = ""
float_framebuffer0 = "false"
srgb_framebuffer0 = "false"
scale_type_x0 = "source"
scale_x0 = "1.000000"
scale_type_y0 = "source"
scale_y0 = "1.000000"
shader1 = "../shaders_slang/stock.slang"
filter_linear1 = "true"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = ""
float_framebuffer1 = "false"
srgb_framebuffer1 = "false"
scale_type_x1 = "source"
scale_x1 = "1.000000"
scale_type_y1 = "source"
scale_y1 = "1.000000"
shader2 = "../shaders_slang/misc/grade.slang"
filter_linear2 = "true"
wrap_mode2 = "clamp_to_border"
mipmap_input2 = "false"
alias2 = "WhitePointPass"
float_framebuffer2 = "false"
srgb_framebuffer2 = "false"
scale_type_x2 = "source"
scale_x2 = "1.000000"
scale_type_y2 = "source"
scale_y2 = "1.000000"
shader3 = "../shaders_slang/crt/shaders/guest/afterglow.slang"
filter_linear3 = "true"
wrap_mode3 = "clamp_to_border"
mipmap_input3 = "false"
alias3 = "AfterglowPass"
float_framebuffer3 = "false"
srgb_framebuffer3 = "false"
scale_type_x3 = "source"
scale_x3 = "1.000000"
scale_type_y3 = "source"
scale_y3 = "1.000000"
shader4 = "../shaders_slang/crt/shaders/guest/avg-lum.slang"
filter_linear4 = "true"
wrap_mode4 = "clamp_to_border"
mipmap_input4 = "true"
alias4 = "AvgLumPass"
float_framebuffer4 = "true"
srgb_framebuffer4 = "false"
scale_type_x4 = "source"
scale_x4 = "1.000000"
scale_type_y4 = "source"
scale_y4 = "1.000000"
shader5 = "../shaders_slang/crt/shaders/guest/linearize.slang"
filter_linear5 = "true"
wrap_mode5 = "clamp_to_border"
mipmap_input5 = "false"
alias5 = "LinearizePass"
float_framebuffer5 = "true"
srgb_framebuffer5 = "false"
scale_type_x5 = "source"
scale_x5 = "1.000000"
scale_type_y5 = "source"
scale_y5 = "1.000000"
shader6 = "../shaders_slang/crt/shaders/guest/blur_horiz.slang"
filter_linear6 = "true"
wrap_mode6 = "clamp_to_border"
mipmap_input6 = "false"
alias6 = ""
float_framebuffer6 = "true"
srgb_framebuffer6 = "false"
scale_type_x6 = "source"
scale_x6 = "1.000000"
scale_type_y6 = "source"
scale_y6 = "1.000000"
shader7 = "../shaders_slang/crt/shaders/guest/blur_vert.slang"
filter_linear7 = "true"
wrap_mode7 = "clamp_to_border"
mipmap_input7 = "false"
alias7 = "GlowPass"
float_framebuffer7 = "true"
srgb_framebuffer7 = "false"
scale_type_x7 = "source"
scale_x7 = "1.000000"
scale_type_y7 = "source"
scale_y7 = "1.000000"
shader8 = "../shaders_slang/crt/shaders/guest/linearize_scanlines.slang"
filter_linear8 = "true"
wrap_mode8 = "clamp_to_border"
mipmap_input8 = "false"
alias8 = ""
float_framebuffer8 = "true"
srgb_framebuffer8 = "false"
scale_type_x8 = "source"
scale_x8 = "1.000000"
scale_type_y8 = "source"
scale_y8 = "1.000000"
shader9 = "../shaders_slang/crt/shaders/guest/crt-guest-dr-venom.slang"
filter_linear9 = "true"
wrap_mode9 = "clamp_to_border"
mipmap_input9 = "false"
alias9 = ""
float_framebuffer9 = "false"
srgb_framebuffer9 = "false"
scale_type_x9 = "viewport"
scale_x9 = "1.000000"
scale_type_y9 = "viewport"
scale_y9 = "1.000000"
parameters = "g_gamma_in;g_signal_type;g_gamma_type;g_crtgamut;g_space_out;g_hue_degrees;g_I_SHIFT;g_Q_SHIFT;g_I_MUL;g_Q_MUL;g_lum_fix;g_vignette;g_vstr;g_vpower;g_lum;g_cntrst;g_mid;wp_temperature;g_sat;g_satr;g_satg;g_satb;g_vibr;g_lift;blr;blg;blb;wlr;wlg;wlb;rg;rb;gr;gb;br;bg;LUT_Size1;LUT1_toggle;LUT_Size2;LUT2_toggle;SW;AR;PR;AG;PG;AB;PB;sat;lsmooth;GAMMA_INPUT;TAPSH;GLOW_FALLOFF_H;TAPSV;GLOW_FALLOFF_V;TATE;IOS;OS;BLOOM;brightboost;brightboost1;gsl;scanline1;scanline2;beam_min;beam_max;beam_size;h_sharp;s_sharp;csize;bsize;warpX;warpY;glow;shadowMask;masksize;vertmask;slotmask;slotwidth;double_slot;slotms;mcut;maskDark;maskLight;CGWG;gamma_out;spike;inter;interm;bloom;scans"
g_gamma_in = "2.500000"
g_signal_type = "0.000000"
g_gamma_type = "1.000000"
g_crtgamut = "2.000000"
g_space_out = "0.000000"
g_hue_degrees = "0.000000"
g_I_SHIFT = "0.000000"
g_Q_SHIFT = "0.000000"
g_I_MUL = "1.000000"
g_Q_MUL = "1.000000"
g_lum_fix = "0.000000"
g_vignette = "0.000000"
g_vstr = "40.000000"
g_vpower = "0.200000"
g_lum = "0.000000"
g_cntrst = "0.000000"
g_mid = "0.500000"
wp_temperature = "6505.000000"
g_sat = "0.000000"
g_satr = "0.000000"
g_satg = "0.000000"
g_satb = "0.000000"
g_vibr = "0.000000"
g_lift = "0.000000"
blr = "0.000000"
blg = "0.000000"
blb = "0.000000"
wlr = "1.000000"
wlg = "1.000000"
wlb = "1.000000"
rg = "0.000000"
rb = "0.000000"
gr = "0.000000"
gb = "0.000000"
br = "0.000000"
bg = "-0.005000"
LUT_Size1 = "16.000000"
LUT1_toggle = "0.000000"
LUT_Size2 = "64.000000"
LUT2_toggle = "0.000000"
SW = "1.000000"
AR = "0.070000"
PR = "0.050000"
AG = "0.070000"
PG = "0.050000"
AB = "0.070000"
PB = "0.050000"
sat = "0.100000"
lsmooth = "0.900000"
GAMMA_INPUT = "2.400000"
TAPSH = "4.000000"
GLOW_FALLOFF_H = "0.300000"
TAPSV = "4.000000"
GLOW_FALLOFF_V = "0.300000"
TATE = "0.000000"
IOS = "0.000000"
OS = "1.000000"
BLOOM = "0.000000"
brightboost = "0.500000"
brightboost1 = "1.500001"
gsl = "2.000000"
scanline1 = "15.000000"
scanline2 = "5.000000"
beam_min = "1.000000"
beam_max = "0.800000"
beam_size = "0.000000"
h_sharp = "3.000000"
s_sharp = "1.000000"
csize = "0.000000"
bsize = "600.000000"
warpX = "0.000000"
warpY = "0.000000"
glow = "0.020000"
shadowMask = "3.000000"
masksize = "1.000000"
vertmask = "0.000000"
slotmask = "0.000000"
slotwidth = "2.000000"
double_slot = "1.000000"
slotms = "1.000000"
mcut = "0.250000"
maskDark = "0.500000"
maskLight = "1.500000"
CGWG = "0.300000"
gamma_out = "2.400000"
spike = "1.000000"
inter = "400.000000"
interm = "1.000000"
bloom = "0.000000"
scans = "1.000000"
textures = "SamplerLUT1;SamplerLUT2;SamplerLUT3"
SamplerLUT1 = "../shaders_slang/crt/shaders/guest/lut/sony_trinitron1.png"
SamplerLUT1_linear = "true"
SamplerLUT1_wrap_mode = "clamp_to_border"
SamplerLUT1_mipmap = "false"
SamplerLUT2 = "../shaders_slang/crt/shaders/guest/lut/sony_trinitron2.png"
SamplerLUT2_linear = "true"
SamplerLUT2_wrap_mode = "clamp_to_border"
SamplerLUT2_mipmap = "false"
SamplerLUT3 = "../shaders_slang/crt/shaders/guest/lut/other1.png"
SamplerLUT3_linear = "true"
SamplerLUT3_wrap_mode = "clamp_to_border"
SamplerLUT3_mipmap = "false"
That’s unexpected, actually it should be otherwise. Could you test without the scanlines (only grade)?
I didn’t do any changes to the phosphors gamut but it might behave differently due to the fixed rolled_gain. I will test tomorrow.
This is with your settings.
If you mean the blue bar, that’s the effect of adding blue (D65) to something already blue -> out of gamut and clipping away values. Something smarter like perceptual intent or CIECAM should be desired but I’m still studying that.
One option is to reduce Hue vs SAT Blue to -0.17.
Thanks for checking that.
Another option, I found, is to lower white-blue a bit.
Everything looks great, otherwise
@Nesguy did you check with the latest shader from Dogway’s repo , or the one from the buildbot / libretro git? His repo is the one up-to-date with the latest changes.
I find this very interesting, do you have an idea what blue primary CIE coordinate would mitigate this?
Would a monitor which supports Rec.2020 solve this? *** Or would a monitor that’s capable by it’s native gamut to reach more saturated blue by a little already be enough? If so what coordinate should we try to get a reliable calibration for?
*** I’m seeing on the Rec.2020 wiki that it has the wider gamut on blue.
The other “regular” gamuts (sRGB, DCI, Rec.709) seem to have the same blue value, even if in the case of DCI they’re advertised as wide gamut… hmmm… which apparently is not true for blue and/or sufficient for “CRT blue”?
I was just using the “update shaders” option in Retroarch. I’ll check out the latest version on Github.
Yeah Nesguy is familiar with his GitHub lol.
Help is always appreciated though.
I really need to test this out but the lazy is real right now. House is too hot.
The problem with White-Blue is that it is generalized, it will lower blue everywhere that is not a primary. HUE vs SAT blue is more akin to CIECAM behaviour.
I’m trying to settle down all my updates before I push a PR to RA repo. So far I’m happy with my latest updates but if you have any issues let me know so I can have a look before doing so.
@rafan, I recall mentioning this, but almost all gamuts are anchored at blue primary. Rec.2020 is a virtual gamut in the sense no display can show 100% Rec.2020. The best course of action here is a smart gamut mapping. I think I got it, but haven’t tested enough the last days.
Any idea why these gamuts are anchored at this blue then (since it seems to fall short when compared to CRT)? I would assume with the transition to the sRGB standard this would have been done carefully as to not loose compatibility with the >1 billion of CRT monitor’s out there? Or am I missing the clue here?
Ah, didn’t realize 2020 isn’t available yet on any screens. It would be nice to see whether blue would show without clipping on a real late 90’s Sony BVM CRT. It should I guess, but then I wonder what blue phospor those things were produced with.
Can you provide some more information on what you intend to do with smart gamut mapping?
I don’t know but probably related to the chemical properties of the material required for LED phosphors. Brands are having a hard time to even produce a Rec.2020 compliant display, that can give you a clue why it’s not an easy task.
I guess a good comparison could be a Japanese BVM tuned to D93, then pass the test suite there.
What I’m trying to do is a rendering intent in ICC terms or a chromatic adaptation in CIE terms. This is so all colors fit into sRGB gamut in a smart way, so it shows no clipping like shown above.
@Dogway I’m noticing the “Blue-Green Tint” adjustment is what I like with almost all the preset CRT gamuts in grade, so I’m just curious whether it would result in same (or better) picture when the “-0.10” Blue-Green Tint adjustment is done through direct “correction” of one of the CRT gamuts. Could you comment on what this “Blue-Green Tint” adjustment of -0.10 is actually doing in context of the CIE primary coordinates? (And as such whether I could also achieve this Tint adjustment through a modified/custom CRT gamut?)
Do you mean the HUE vs SAT blue? I never recommended that value for Blue-Green Tint but rather an increase +0.10, that means adding Green to Blue so the sky is Azure Blue and not Deep Blue. This is what happens when you first use a CRT gamut, and later color manage RA to your display which you can do now with a Reshade LUT (I just updated grade to master repo 2 days ago).
In other words, if you color manage RA with a LUT you don’t need the Blue-Green Tint, but you still need to lower HUE vs SAT blue because we are adding too much blue -out of gamut- with a D93 temperature.
Thanks for the answer, but I’m not touching the Hue vs Sat. I’m only changing “Blue-Green Tint”, the parameter as it is called in your shader:
#pragma parameter bg “Blue-Green Tint” 0.0 -1.0 1.0 0.005
Could you comment on what this “Blue-Green Tint” adjustment (of -0.10 in my case) is actually doing in context of the CIE primary coordinates? And as such whether I could also achieve this Tint adjustment through a modified/custom CRT gamut?
EDIT: I’m asking the above for the case of -NOT- color managing RA. Just plain vanilla grade shader on a good (say deltaE <3) factory calibrated sRGB monitor.
EDIT2: I’m also touching “Green-Blue Tint” and “Blue-Red Tint” a bit, but I don’t want to make my above question too complicated. For my understanding, I’m mostly interested in whether the “Blue-Green Tint” parameter as per your shader, what a value of -0.10 means in the context of CIE primaries (is it a “lowering” of both blue and green primary coordinates?)
No it’s altering how much green is in the blue channel.
Yes that is what I observe, but my question is how does that relate to the CIE chromaticity primaries?
It seems I’m not making myself clear enough. Is setting “Blue-Green Tint” bg parameter to -0.10 correlated to a shift in the color gamut “triangle”, yes or no? And if yes, what shift in the B and G CIE chromaticity primary coordinates does it correlate to? Or is this doing something totally different and not related to the CRT gamut?