Dogway's grading shader (slang)

Glass is working great on my end.

This is second time you’ve caused me to swap shaders in my chain. First I replaced color mangler for grade, now I’m swapping the afterglow shader for glass, lol.

All I need now is a proper VHS shader, and a good signal switch shader(RF, Composite, S-Video, RGB) and I’m set, lol.

Look forward to your updates on glass!

1 Like

@Syh, Thanks!! Actually I was fed up using so many shaders in a non-optimized way. I wanted theme based shaders to put everything related together so I’m happy with both, specially grade since real analogue colors are now emulated, long journey but I learned a lot.

For the signal artifacts shader don’t count me in lol. I just want some s-video kind of distortion, and then I’ll use a small convolution for RGB games and my ntsc signal for s-video games to get blurriness right.

I have also very present the New Super VI mode shader, I have been reading and testing for the last few days, I really want to get rid of polygon jaggies in a raster manner.

I recalled what I wanted to say, if you don’t have a calibrated display with an instrument one of the best things you can do is what we have been doing already, green to blue, blue to green, and there’s also some blue to red. This kind of thing removes the purity of colors and hence it’s saturation. With the matrix transform now I can set those to zero and the image will look good.

2 Likes

I didn’t hear no for the VHS, lol.

Honestly I’d probably be content with an svideo/RGB signal shader, as I’d never end up using rf/composite, lol.

Are you talking about N64? That thing is a pain.

I’ve been pushing green to blue and blue to green, didn’t think about pushing blue to red.

1 Like

It’s just a median filter but I’m kind of trapped in the inner workings of glsl. There are some macros to be done and I’m having difficulties with those. There’s no real example in the slang repo aside those I suggested which are a bit over the head (not really beautiful code, -from source-).

For reds probable yellow to red, I’m not sure, I’ve been dabbling with green to red at 0.02.

1 Like

So Green/blue to red, hmmm. I’ll have to try that.

In this context, you use it to profile your monitor and then use the app’s LUT tool to convert a standard like SMPTE-C to Your monitors actual gamut (in my case 110% Adobe RGB). You would then use a program like Reshade to apply the LUT. In this case, we can also use the shaders ability to use a lut to apply it. You have to configure the correct size, which is 64.

I use a separate program to calibrate my monitor automatically: NEC’s Spectraview II.

3 Likes

Re-downloaded both grade.slang and glass.slang and now I can’t save a preset with either of those shaders in the chain. Also your presets no longer seem to load either. Any ideas?

@cobhc2016 I just tested and it works for me. There might be an incompatibility with your preset (my presets need an update with the latest changes). Try this:

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_vdither;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;g_csize;g_bsize;g_flicker;g_shaker;g_refltog;g_reflgrain;g_reflstr;g_fresnel;g_reflblur;gz;gx;gy;gzr;gzg;gzb;goxr;goyr;goxg;goyg;goxb;goyb;TO;PH;PER;ASAT;temperature;luma_preserve;wp_red;wp_green;wp_blue"

// GRADE
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_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 = "1.000000"
wlg = "1.000000"
wlb = "1.000000"
rg = "0.000000"
rb = "0.000000"
gr = "0.000000"
gb = "0.030000"
br = "0.000000"
bg = "0.095000"
LUT_Size1 = "16.000000"
LUT1_toggle = "0.000000"
LUT_Size2 = "64.000000"
LUT2_toggle = "0.000000"

// NTSC adaptive
quality = "1.000000"
bw = "0.000000"
linearize = "0.000000"

// GLASS
g_csize = "0.020000"
g_bsize = "300.000000"
g_flicker = "0.100000"
g_shaker = "0.010000"
g_refltog = "1.000000"
g_reflgrain = "0.100000"
g_reflstr = "0.200000"
g_fresnel = "1.000000"
g_reflblur = "0.600000"
gz = "1.100000"
gx = "0.000000"
gy = "-0.010000"
gzr = "1.080000"
gzg = "1.030000"
gzb = "1.000000"
goxr = "0.000000"
goyr = "-0.010000"
goxg = "0.000000"
goyg = "-0.010000"
goxb = "0.000000"
goyb = "0.000000"
TO = "1.000000"
PH = "2.000000"
PER = "0.800000"
ASAT = "0.200000"
temperature = "12047.000000"
luma_preserve = "1.000000"
wp_red = "0.000000"
wp_green = "0.000000"
1 Like

I fixed the presets so they should load now.

1 Like

I tried that and get the below error in my logs.

[INFO] [slang]: Compiling shader "C:\Users\Stee\AppData\Roaming\RetroArch\shaders\shaders_slang\misc\grade.slang".
[ERROR] First line of the shader must contain a valid #version string.
[ERROR] Failed to compile shader: "C:\Users\Stee\AppData\Roaming\RetroArch\shaders\shaders_slang\misc\grade.slang".
[ERROR] [Vulkan]: Failed to create preset: "C:\Users\Stee\AppData\Roaming\RetroArch\shaders\shaders_slang\crt\crt-guest-dr-venom-256px-320px-grade.slangp".
[ERROR] [Vulkan]: Failed to create filter chain: "C:\Users\Stee\AppData\Roaming\RetroArch\shaders\shaders_slang\crt\crt-guest-dr-venom-256px-320px-grade.slangp". Falling back to stock.

I’ll try the new presets as well though. Thanks for the help.

Strange, grade.slang has “#version 450” as the first line.

I overwrote everything and it’s working again. I didn’t edit the slang files so I’m not sure what happened but it’s all good again now. While I have your attention, any recommendations on 480i content such as Dreamcast/some MAME games? I’ve been using the RGB preset which looks good but wondered if I’m missing something else I should be changing?

2 Likes

I don’t have any preset with interlacing support (unless you want to try the “interlace_detect_toggle” -untested-). But for 480p content I use plain rgb crt-royale but with pre-scaling to 1080p, so crt-royale doesn’t trigger interlacing mode.

shader1 = "..\..\shaders_glsl\ntsc\shaders\ntsc-pass1-svideo-2phase.glsl"
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_glsl\ntsc\shaders\ntsc-pass2-2phase.glsl"
filter_linear2 = "true"
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 = "absolute"
scale_y2 = "1080"
2 Likes

Hi @Dogway I’m really curious about your glass deconvergence stuff, so you have and images of this effect on a real crt? I’m just curious what a real world example looks like…

3 Likes

It’s refraction and dispersion of light due to different wavelength speeds on a glass medium (wiki ). A little goes a long way but I haven’t done the maths (it would need to go along the screen curvature anyway). It automatically does content deconvergence too so you can see it as an augmented version of the deconverged content. I think it’s better to don’t add too many settings.

This is an off-angle PVM, you can see glass inner-reflection: More images (good quality CRTs are a trend):

5 Likes

And meanwhile I add more settings lol. Updated grade with hue vs sat options, notice it also works along Dullness/Vibrance, so as an example, you can lower red saturation only where it’s more saturated. @Syh this thing is for you.

1 Like

I feel personally attacked! Do you not enjoy me cranking up the red channel saturation into space? (Lol)

As currently I have the saturation in my copy of grade split into separate RGB channels for per channel adjustment.

Could you elaborate on these changes some?

Ok, I’ve looked over the code. Haven’t tested yet as house is too hot for the PC to live.

It’s similar-ish to what I’m doing with the separate saturation channels but fancier. (And most likely more thought out, lol.)

Could you give a more in-depth explanation about the “hue vs sat” settings? Like what does decreasing it vs increasing it do (does it start altering hue instead of saturation?)

1 Like

Yeah, it’s hot here as well : /

A plain RGB per channel saturation yields a tinted image overall because you are overall removing that color out. Hue vs Sat removes saturation on a per color (not channel) basis, so for Hue Red/Green/Blue Add/Subtract Saturation. I guess this is more intended as we have plenty of tint controls like YIQ Shift, White Point and White to RGB. I started to be nitpicking adusting colors for CPS so I went ahead and included it.

Now add to the above equation the Dullness/Vibrance explanation of this post, and you get a very powerful tool to control saturation in very specific areas.

2 Likes

Sorry I’m just wanting to make sure I’m understanding you correctly.

Hue vs sat is removing saturation on a hue basis vs doing it via RGB? Increasing it adds saturation to that hue section, whereas decreasing it removes saturation from that hue section? Making the saturation setting a primary adjustment, that you then use the hue vs sat settings to do the fine tuning tweaks (decreasing/increasing saturation for certain hue sections). (So less stupid saturation adjustment?)

I imagine the hue vs sat settings cause some overlap in where saturation is being adjusted in the overall hue? (As purple should fall under both red and blue at least to my knowledge, which would be affected by both “hue vs sat” red and “hue vs sat” blue together.)

I understand the dull/vibrance settings, I will have to start actually using it though it seems.

1 Like