Dogway's grading shader (slang)

Yes I will add notes for the setting in the guide, but beyond that it’s just some technicality that’s fun for geeks like us, don’t want to confuse power users lol.

The problem with adjusting limited range in nvidia settings is that while you can, you shouldn’t. That thing is just for back compatibility for the “TV” levels required for back porch and other things in desuse (except broadcast and movies for other reasons). I mean the games are already in PC levels, your display is in PC levels so it makes sense to don’t overfilter, the output should look the same (were I preconvert the game to TV levels), just with worse quality. There’s only an exception, I did a TV levels roundtrip to have an accurate feedback of the analogue color controls, that’s all.

1 Like

Setting the graphics card to “full range” definitely seems like the right way to go. The colors are a lot better but you definitely get some crushed blacks. I think an adjustment to the TV’s brightness or raising black level in the shader can compensate, but maybe there’s a better/more accurate way…?

1 Like

Crushed blacks? Probably the TV needs some adjustments, I would use a target pattern in PC levels to see everything’s in range (use a color managed program for this like PS or Firefox). When you are done with that the game should look fine or it’s another issue shader-setting related (after the target pattern in PC levels -no retroarch- check the color bars in the test suite)

1 Like

Due to my somewhat chaotic living situation, I find myself using a new TV every few weeks, lol.

I think some TVs are only designed to show limited range…?

“limited range” was the default setting when I hooked up this TV. After some adjustments to brightness and contrast it looks like everything is in range according to Lagom test patterns viewed with Firefox when limited range is selected. If I use full range, the colors look slightly better but the blacks are crushed and I have to crank up the black level to compensate.

So, I’m still confused. :stuck_out_tongue: Should we leave the graphics card setting at limited range or full range? Or is this setting maybe something that is display-dependent?

1 Like

Sure, if your TV doesn’t have full RGB mode use limited in graphics card. Sounds strange to me what HDTV doesn’t use full while in RGB mode.

If you have everything setup to limited all is fine. The GPU will scale full range to limited to present that range to the limited TV.

1 Like

By the way, after the conversation a few days ago on afterglow and persistence I decided to take a look and modified venom’s afterglow to include said changes. The main things were more accurate afterglow luminosity by phosphor type and eye cone response and a more accurate decay rate upon this pdf.

Uploaded to my repository, to be realistic the persistence setting should be set to 3.0 but you can be creative too. It’s also simpler as you don’t have so many RGB settings now, only a preset one akin to grade’s gamut one.

EDIT: This is not complete, it doesn’t take into account the chemical decay rate factor, only the luminance ones, need good references still.

2 Likes

I think some older HDTVs don’t support full range RGB. An easy way to test this is to simply send the TV a full range signal and check a black level test pattern. If the display is calibrated correctly and it doesn’t support full range, then blacks 0-15 will be crushed.

Basically, I think we just want to leave the graphics card settings alone. If it detected the display correctly then it should automatically choose the limited or full range.

I think the only time you’d want to change this is if the display was incorrectly identified as a limited range display when it’s actually capable of full range, but I imagine this is pretty rare.

I can’t get grade to load now ever since the rebase to RC6. Thought LUT size would be the culprit again but still no luck after changing them to 32.

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_space_out;g_gamma_in;g_gamma_type;g_crtgamut;g_hue_degrees;g_I_SHIFT;g_Q_SHIFT;g_I_MUL;g_Q_MUL;g_vignette;g_vstr;g_vpower;wp_temperature;g_sat;g_vibr;g_lum;g_cntrst;g_mid;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_space_out = "0.000000"
g_gamma_in = "2.399999"
g_gamma_type = "2.000000"
g_crtgamut = "2.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_vignette = "0.000000"
g_vstr = "40.000000"
g_vpower = "0.200000"
wp_temperature = "9305.000000"
g_sat = "0.000000"
g_vibr = "0.000000"
g_lum = "0.000000"
g_cntrst = "0.000000"
g_mid = "0.500000"
g_lift = "0.000000"
blr = "0.000000"
blg = "0.000000"
blb = "0.000000"
wlr = "1.000000"
wlg = "1.000000"
wlb = "1.000000"
rg = "-0.005000"
rb = "0.000000"
gr = "0.000000"
gb = "0.000000"
br = "0.000000"
bg = "-0.005000"
LUT_Size1 = "32.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.200000"
TAPSH = "4.000000"
GLOW_FALLOFF_H = "0.000000"
TAPSV = "4.000000"
GLOW_FALLOFF_V = "0.000000"
TATE = "0.000000"
IOS = "0.000000"
OS = "1.000000"
BLOOM = "0.000000"
brightboost = "1.000000"
brightboost1 = "1.000000"
gsl = "2.000000"
scanline1 = "10.000000"
scanline2 = "5.000000"
beam_min = "1.000000"
beam_max = "1.000000"
beam_size = "0.000000"
h_sharp = "4.000000"
s_sharp = "0.000000"
csize = "0.000000"
bsize = "600.000000"
warpX = "0.000000"
warpY = "0.000000"
glow = "0.000000"
shadowMask = "3.000000"
masksize = "1.000000"
vertmask = "0.000000"
slotmask = "0.000000"
slotwidth = "2.000000"
double_slot = "1.000000"
slotms = "1.000000"
mcut = "0.000000"
maskDark = "0.500000"
maskLight = "1.500000"
CGWG = "0.000000"
gamma_out = "2.200000"
spike = "1.000000"
inter = "400.000000"
interm = "1.000000"
bloom = "0.100000"
scans = "0.500000"
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 = "cl
amp_to_border"
SamplerLUT3_mipmap = "false"

Maybe a conflicting setting with old preset, try these settings (using venom in this case):

EDIT: is your SamplerLUT3_wrap_mode line ok?

parameters = "g_space_out;g_gamma_in;g_gamma_type;g_crtgamut;g_hue_degrees;g_I_SHIFT;g_Q_SHIFT;g_I_MUL;g_Q_MUL;g_lum_fix;g_vignette;g_vstr;g_vpower;wp_temperature;g_sat;g_vibr;g_lum;g_cntrst;g_mid;g_lift;blr;blg;blb;wlr;wlg;wlb;rg;rb;gr;gb;br;bg;LUT_Size1;LUT1_toggle;LUT_Size2;LUT2_toggle;quality;bw;linearize;CP;CS;WP;wp_saturation;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_space_out = "0.000000"
g_gamma_in = "2.400000"
g_gamma_type = "2.000000"
g_crtgamut = "2.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 = "1.000000"
g_vstr = "50.000000"
g_vpower = "0.500000"
wp_temperature = "9305.000000"
g_sat = "0.000000"
g_vibr = "0.000000"
g_lum = "0.000000"
g_cntrst = "0.000000"
g_mid = "0.500000"
g_lift = "0.040000"
blr = "0.000000"
blg = "0.000000"
blb = "0.000000"
wlr = "0.000000"
wlg = "0.000000"
wlb = "1.000000"
rg = "0.000000"
rb = "0.000000"
gr = "0.000000"
gb = "0.000000"
br = "0.000000"
bg = "0.000000"
LUT_Size1 = "16.000000"
LUT1_toggle = "0.000000"
LUT_Size2 = "64.000000"
LUT2_toggle = "0.000000"
quality = "1.000000"
bw = "0.000000"
linearize = "0.000000"
CP = "-1.000000"
CS = "0.000000"
WP = "0.000000"
wp_saturation = "1.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.200000"
TAPSH = "4.000000"
GLOW_FALLOFF_H = "0.300000"
TAPSV = "4.000000"
GLOW_FALLOFF_V = "0.300000"
TATE = "0.000000"
IOS = "0.000000"
OS = "2.000000"
BLOOM = "0.000000"
brightboost = "1.400000"
brightboost1 = "1.000000"
gsl = "2.000000"
scanline1 = "6.000000"
scanline2 = "8.000000"
beam_min = "1.350000"
beam_max = "1.050000"
beam_size = "0.700000"
h_sharp = "3.500000"
s_sharp = "0.400000"
csize = "0.000000"
bsize = "100.000000"
warpX = "0.040000"
warpY = "0.040000"
glow = "0.050000"
shadowMask = "2.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.250000"
CGWG = "0.300000"
gamma_out = "2.200000"
spike = "1.000000"
inter = "400.000000"
interm = "0.000000"
bloom = "0.500000"
scans = "0.500000"
textures = "SamplerLUT1;SamplerLUT2"
SamplerLUT1 = "../../shaders_slang/reshade/shaders/LUT/16.png"
SamplerLUT1_linear = "true"
SamplerLUT1_wrap_mode = "clamp_to_border"
SamplerLUT1_mipmap = "false"
SamplerLUT2 = "../../shaders_slang/reshade/shaders/LUT/64.png"
SamplerLUT2_linear = "true"
SamplerLUT2_wrap_mode = "clamp_to_border"
SamplerLUT2_mipmap = "false"
1 Like

I’m dumb; I was accidentally pasting grade.glsl into grade.slang :man_facepalming:

Latest version works fine :stuck_out_tongue:

Would be nice at some point to add some presets for I/Q shift that correspond to different color temps. 9300K is a bit much, now. Also looking forward to your findings relating to masks and brightness.

1 Like

Yes, I said in the other thread but actually the NTSC-J gamut looks that blue if I didn’t compensate it to D65 beforehand, so the white point refactor is correct now with the benefit that you can now use whatever temperature suits you. When using the Shift setting I rarely go below -0.06, but that’s because I have my display correctly calibrated to D65.

I have to calibrate in dark so at night, I will test my mask implementations (BW pattern) and also royale by your guidance, max backlight then adjust mask up to 120 nits on display. I guess my results would only work for my masks as every other one is different.

Oh, updated grade to also apply phosphor gamut on RGB signals (a new setting for signal type here), also restored back gamut limiting in YUV space, now using correct limit coeffs.

2 Likes

Could you elaborate on this some?

1 Like

For arcade games, you might not want all the YUV, YIQ, TV level conversions, but still want phosphor gamut emulation, so set signal type to RGB.

1 Like

If someone can help me here, probably @Syh, this is my snes preset using venom. I’m trying to put glass after afterglow (mine or vanilla doesn’t matter). Afterglow won’t work but everything else does. It’s strange because if I don’t use the ntsc passes before it works:

shaders = "11"
shader0 = "..\..\shaders_slang\misc\grade.slang"
filter_linear0 = "false"
wrap_mode0 = "clamp_to_border"
mipmap_input0 = "false"
alias0 = ""
float_framebuffer0 = "true"
srgb_framebuffer0 = "false"
scale_type_x0 = "source"
scale_x0 = "1.000000"
scale_type_y0 = "source"
scale_y0 = "1.000000"
shader1 = "..\..\shaders_slang\ntsc\shaders\ntsc-adaptive\ntsc-pass1.slang"
filter_linear1 = "false"
wrap_mode1 = "clamp_to_border"
frame_count_mod1 = "2"
mipmap_input1 = "false"
alias1 = ""
float_framebuffer1 = "true"
srgb_framebuffer1 = "false"
scale_type_x1 = "absolute"
scale_x1 = "1280"
scale_type_y1 = "source"
scale_y1 = "1.000000"
shader2 = "..\..\shaders_slang\ntsc\shaders\ntsc-adaptive\ntsc-pass2.slang"
filter_linear2 = "false"
wrap_mode2 = "clamp_to_border"
mipmap_input2 = "false"
alias2 = ""
float_framebuffer2 = "false"
srgb_framebuffer2 = "false"
scale_type_x2 = "source"
scale_x2 = "0.500000"
scale_type_y2 = "source"
scale_y2 = "1.000000"
shader3 = "..\..\shaders_slang\misc\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\misc\glass.slang"
filter_linear4 = "true"
wrap_mode4 = "clamp_to_border"
mipmap_input4 = "false"
alias4 = "WhitePointPass"
float_framebuffer4 = "false"
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\avg-lum.slang"
filter_linear5 = "true"
wrap_mode5 = "clamp_to_border"
mipmap_input5 = "true"
alias5 = "AvgLumPass"
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\linearize.slang"
filter_linear6 = "true"
wrap_mode6 = "clamp_to_border"
mipmap_input6 = "false"
alias6 = "LinearizePass"
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_horiz.slang"
filter_linear7 = "true"
wrap_mode7 = "clamp_to_border"
mipmap_input7 = "false"
alias7 = ""
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\blur_vert.slang"
filter_linear8 = "true"
wrap_mode8 = "clamp_to_border"
mipmap_input8 = "false"
alias8 = "GlowPass"
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\linearize_scanlines.slang"
filter_linear9 = "true"
wrap_mode9 = "clamp_to_border"
mipmap_input9 = "false"
alias9 = ""
float_framebuffer9 = "true"
srgb_framebuffer9 = "false"
scale_type_x9 = "source"
scale_x9 = "1.000000"
scale_type_y9 = "source"
scale_y9 = "1.000000"
shader10 = "..\..\shaders_slang\crt\shaders\guest\crt-guest-dr-venom.slang"
filter_linear10 = "true"
wrap_mode10 = "clamp_to_border"
mipmap_input10 = "false"
alias10 = ""
float_framebuffer10 = "false"
srgb_framebuffer10 = "false"
scale_type_x10 = "viewport"
scale_x10 = "1.000000"
scale_type_y10 = "viewport"
scale_y10 = "1.000000"
parameters = "g_space_out;g_gamma_in;g_gamma_type;g_crtgamut;g_hue_degrees;g_I_SHIFT;g_Q_SHIFT;g_I_MUL;g_Q_MUL;g_lum_fix;g_vignette;g_vstr;g_vpower;wp_temperature;g_sat;g_vibr;g_lum;g_cntrst;g_mid;g_lift;blr;blg;blb;wlr;wlg;wlb;rg;rb;gr;gb;br;bg;LUT_Size1;LUT1_toggle;LUT_Size2;LUT2_toggle;quality;bw;linearize;CP;CS;WP;wp_saturation;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_space_out = "0.000000"
g_gamma_in = "2.400000"
g_gamma_type = "2.000000"
g_crtgamut = "2.000000"
g_hue_degrees = "0.000000"
g_I_SHIFT = "-0.050000"
g_Q_SHIFT = "0.000000"
g_I_MUL = "0.980000"
g_Q_MUL = "0.980000"
g_lum_fix = "0.000000"
g_vignette = "1.000000"
g_vstr = "50.000000"
g_vpower = "0.500000"
wp_temperature = "6505.000000"
g_sat = "-0.020000"
g_vibr = "0.000000"
g_lum = "0.000000"
g_cntrst = "0.000000"
g_mid = "0.500000"
g_lift = "0.040000"
blr = "0.000000"
blg = "0.000000"
blb = "0.000000"
wlr = "0.950000"
wlg = "0.900000"
wlb = "1.100000"
rg = "0.000000"
rb = "0.000000"
gr = "0.000000"
gb = "0.030000"
br = "0.000000"
bg = "0.150000"
LUT_Size1 = "16.000000"
LUT1_toggle = "0.000000"
LUT_Size2 = "64.000000"
LUT2_toggle = "0.000000"
quality = "1.000000"
bw = "0.000000"
linearize = "0.000000"
CP = "-1.000000"
CS = "0.000000"
WP = "0.000000"
wp_saturation = "1.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.200000"
TAPSH = "4.000000"
GLOW_FALLOFF_H = "0.300000"
TAPSV = "4.000000"
GLOW_FALLOFF_V = "0.300000"
TATE = "0.000000"
IOS = "0.000000"
OS = "2.000000"
BLOOM = "0.000000"
brightboost = "1.400000"
brightboost1 = "1.000000"
gsl = "2.000000"
scanline1 = "6.000000"
scanline2 = "8.000000"
beam_min = "1.350000"
beam_max = "1.050000"
beam_size = "0.700000"
h_sharp = "3.500000"
s_sharp = "0.400000"
csize = "0.000000"
bsize = "100.000000"
warpX = "0.040000"
warpY = "0.040000"
glow = "0.050000"
shadowMask = "2.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.250000"
CGWG = "0.300000"
gamma_out = "2.200000"
spike = "1.000000"
inter = "400.000000"
interm = "0.000000"
bloom = "0.500000"
scans = "0.500000"
textures = "SamplerLUT1;SamplerLUT2"
SamplerLUT1 = "..\..\shaders_slang\reshade\shaders\LUT\16.png"
SamplerLUT1_linear = "true"
SamplerLUT1_wrap_mode = "clamp_to_border"
SamplerLUT1_mipmap = "false"
SamplerLUT2 = "..\..\shaders_slang\reshade\shaders\LUT\64.png"
SamplerLUT2_linear = "true"
SamplerLUT2_wrap_mode = "clamp_to_border"
SamplerLUT2_mipmap = "false"

This works instead:

shaders = "12"
shader0 = "..\misc\grade.slang"
filter_linear0 = "false"
wrap_mode0 = "clamp_to_border"
mipmap_input0 = "false"
alias0 = ""
float_framebuffer0 = "true"
srgb_framebuffer0 = "false"
scale_type_x0 = "source"
scale_x0 = "1.000000"
scale_type_y0 = "source"
scale_y0 = "1.000000"
shader1 = "..\misc\afterglow.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 = "..\misc\glass.slang"
filter_linear2 = "false"
wrap_mode2 = "clamp_to_border"
mipmap_input2 = "false"
alias2 = ""
float_framebuffer2 = "false"
srgb_framebuffer2 = "false"
scale_type_x2 = "source"
scale_x2 = "1.000000"
scale_type_y2 = "source"
scale_y2 = "1.000000"
shader3 = "shaders\guest\color-profiles.slang"
filter_linear3 = "true"
wrap_mode3 = "clamp_to_border"
mipmap_input3 = "false"
alias3 = ""
float_framebuffer3 = "false"
srgb_framebuffer3 = "false"
scale_type_x3 = "source"
scale_x3 = "1.000000"
scale_type_y3 = "source"
scale_y3 = "1.000000"
shader4 = "shaders\guest\d65-d50.slang"
filter_linear4 = "true"
wrap_mode4 = "clamp_to_border"
mipmap_input4 = "false"
alias4 = "WhitePointPass"
float_framebuffer4 = "false"
srgb_framebuffer4 = "false"
scale_type_x4 = "source"
scale_x4 = "1.000000"
scale_type_y4 = "source"
scale_y4 = "1.000000"
shader5 = "..\stock.slang"
filter_linear5 = "true"
wrap_mode5 = "clamp_to_border"
mipmap_input5 = "false"
alias5 = ""
float_framebuffer5 = "false"
srgb_framebuffer5 = "false"
scale_type_x5 = "source"
scale_x5 = "1.000000"
scale_type_y5 = "source"
scale_y5 = "1.000000"
shader6 = "shaders\guest\avg-lum.slang"
filter_linear6 = "true"
wrap_mode6 = "clamp_to_border"
mipmap_input6 = "true"
alias6 = "AvgLumPass"
float_framebuffer6 = "true"
srgb_framebuffer6 = "false"
scale_type_x6 = "source"
scale_x6 = "1.000000"
scale_type_y6 = "source"
scale_y6 = "1.000000"
shader7 = "shaders\guest\linearize.slang"
filter_linear7 = "true"
wrap_mode7 = "clamp_to_border"
mipmap_input7 = "false"
alias7 = "LinearizePass"
float_framebuffer7 = "true"
srgb_framebuffer7 = "false"
scale_type_x7 = "source"
scale_x7 = "1.000000"
scale_type_y7 = "source"
scale_y7 = "1.000000"
shader8 = "shaders\guest\blur_horiz.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\guest\blur_vert.slang"
filter_linear9 = "true"
wrap_mode9 = "clamp_to_border"
mipmap_input9 = "false"
alias9 = "GlowPass"
float_framebuffer9 = "true"
srgb_framebuffer9 = "false"
scale_type_x9 = "source"
scale_x9 = "1.000000"
scale_type_y9 = "source"
scale_y9 = "1.000000"
shader10 = "shaders\guest\linearize_scanlines.slang"
filter_linear10 = "true"
wrap_mode10 = "clamp_to_border"
mipmap_input10 = "false"
alias10 = ""
float_framebuffer10 = "true"
srgb_framebuffer10 = "false"
scale_type_x10 = "source"
scale_x10 = "1.000000"
scale_type_y10 = "source"
scale_y10 = "1.000000"
shader11 = "shaders\guest\crt-guest-dr-venom.slang"
filter_linear11 = "true"
wrap_mode11 = "clamp_to_border"
mipmap_input11 = "false"
alias11 = ""
float_framebuffer11 = "false"
srgb_framebuffer11 = "false"
scale_type_x11 = "viewport"
scale_x11 = "1.000000"
scale_type_y11 = "viewport"
scale_y11 = "1.000000"
parameters = "g_signal_type;g_space_out;g_gamma_in;g_gamma_type;g_vignette;g_vstr;g_vpower;wp_temperature;g_sat;g_crtgamut;g_lum_fix;g_vibr;g_lum;g_cntrst;g_mid;g_lift;blr;blg;blb;wlr;wlg;wlb;rg;rb;gr;gb;br;bg;LUT_Size1;LUT1_toggle;LUT_Size2;LUT2_toggle;quality;bw;linearize;CP;CS;WP;wp_saturation;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.400000"
g_signal_type = "1.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_vignette = "1.000000"
g_vstr = "40.000000"
g_vpower = "0.250000"
wp_temperature = "9305.000000"
g_sat = "0.000000"
g_vibr = "0.000000"
g_lum_fix = "0.000000"
g_lum = "0.000000"
g_cntrst = "0.000000"
g_mid = "0.500000"
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.050000"
LUT_Size1 = "16.000000"
LUT1_toggle = "0.000000"
LUT_Size2 = "64.000000"
LUT2_toggle = "0.000000"
quality = "1.000000"
bw = "0.000000"
linearize = "0.000000"
CP = "0.000000"
CS = "0.000000"
WP = "0.000000"
wp_saturation = "1.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.200000"
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 = "1.400000"
brightboost1 = "1.150000"
gsl = "0.000000"
scanline1 = "6.000000"
scanline2 = "8.000000"
beam_min = "1.350000"
beam_max = "1.050000"
beam_size = "0.700000"
h_sharp = "5.250000"
s_sharp = "0.400000"
csize = "0.000000"
bsize = "600.000000"
warpX = "0.000000"
warpY = "0.000000"
glow = "0.020000"
shadowMask = "0.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 = "0.500000"
textures = "SamplerLUT1;SamplerLUT2"
SamplerLUT1 = "..\reshade\shaders\LUT\16.png"
SamplerLUT1_linear = "true"
SamplerLUT1_wrap_mode = "clamp_to_border"
SamplerLUT1_mipmap = "false"
SamplerLUT2 = "..\reshade\shaders\LUT\64.png"
SamplerLUT2_linear = "true"
SamplerLUT2_wrap_mode = "clamp_to_border"
SamplerLUT2_mipmap = "false"

My guess is something the ntsc shader is doing with color is causing the afterglow shader to not trigger.

Or it may be an issue of stacking in this case, have you tried ntsc then grade?

This isn’t my first time having issues with afterglow, but a good person to ask might also be @HyperspaceMadness.

3 Likes

Yes, Afterglow works by taking pixels which would otherwise be black and if they had color on previous frames this is blended in. If the pixel’s color was never black then it will never get any afterglow. It was something like this that I had run into, so I had to move the color correction affecting the black after the afterglow pass.

In the end I switched to the mame phosphor persistence method which doesn’t have this issue. It also only requires 2 texture samples rather than 5-6 samples.

3 Likes

@Dogway

With the I/Q shift, black is also tinted. Is there a way to keep black black?

Also, why is the range from -100 to 100 when even +10 or -10 seems like way too much? In what situation would you need this much range? Just curious.

1 Like

@HyperspaceMadness Thanks a lot, I was pulling my hair out just wanting to wrap up already! I overlooked that line so I will think about what to do there.

@Nesguy, it’s adding values to each plane, when doing the inverse conversion it takes into account the added values. These formats are not really luma agnostic like White Point’s Yxy. I’m not really sure if this is CRTs behaviour, that code block was copied from Doriphor’s ntsc shader but I might have a look at it. I’m just really tired of this shader and want to jump into other things lol.

1 Like

Updated afterglow removing the hard limit. Also if someone tested my mod before and wasn’t working test now as it had a wrong function type that has been corrected.

Eventually I will merge this into glass.

2 Likes

Been playing around some more with the grade shader, great stuff :slight_smile:

Reading the presets readme your suggestion is to use a SMPTE-C gamma of between 2.35 and 2.55 for NTSC-J. Should I just be using a value that “feels good”, or do you have a suggestion maybe on how to settle on a value in that range?

It’s quite interesting to see more depth in the parallax scrolling in the SNES games I tested when using grade with your suggested presets. (I guess colors in these parallax layers were originally chosen to create that sense of depth.)

######################################...PRESETS...#######################################
##########################################################################################
###                                                                                    ###
###      PAL                                                                           ###
###          Phosphor: EBU (#3) (or an EBU T3213 based CRT phosphor gamut)             ###
###          WP: D65 (6504K)                                                           ###
###          TRC: 2.8 SMPTE-C Gamma                                                    ###
###          Saturation: -0.02                                                         ###
###                                                                                    ###
###      NTSC-U                                                                        ###
###          Phosphor: SMPTE-C (#1)     (or a SMPTE-C based CRT phosphor gamut)        ###
###          WP: D65 (6504K)         (in practice more like ~8000K)                    ###
###          TRC: 2.22 SMPTE-C Gamma (in practice more like 2.35-2.55)                 ###
###                                                                                    ###
###      NTSC-J (Default)                                                              ###
###          Phosphor: NTSC-J (#2)      (or a NTSC-J based CRT phosphor gamut)         ###
###          WP: D93 (9305K)         (or keep D65 and set "I/U Shift = -0.04")         ###
###          TRC: 2.22 SMPTE-C Gamma (in practice more like 2.35-2.55)                 ###
###                                                                                    ###
###      *Despite the standard of 2.22, a more faithful approximation to CRT...        ###
###       ...is to use a gamma (SMPTE-C type) with a value of 2.35-2.55.               ###
###                                                                                    ###
###                                                                                    ###
##########################################################################################
##########################################################################################
2 Likes

Basically “feels good” as each CRT was tuned differently, but if you want to be academic use 2.22. I personally like higher numbers as it depicts a more vintage look.

It is very interesting because yesterday when tuning the shader for different systems I really could see through developer intentions or employed CRT/gamma. I found out that later systems like PSX standardized these kind of things and as such for this system, Saturn and the like I ended up using 2.22 switching on sRGB and SMPTE-C gamma type back and forth, you have to keep in mind scanline darkening compensation. Same with temperature, going forward in time means lowering temperature to D75 and finally D65.

4 Likes