Dogway's grading shader (slang)

It’s doing both to glass and content but with an offset so the glass gets more deconvergence (as it should), but the effect is disabled in the very center through a mask. I tuned this with the Warning screenshot I posted a week or so ago.

Now I’m updating glass.glsl to use on my venom preset (for CPS arcade). I forgot what I was going to say, oh well.

1 Like

So this is glass deconvergence stuff?

#pragma parameter gz "Zoom" 1.2 1.0 1.5 0.01
#pragma parameter gx "Shift-X" 0.0 -1.0 1.0 0.01
#pragma parameter gy "Shift-Y" -0.01 -1.0 1.0 0.01
#pragma parameter gzr "Zoom Red" 1.03 1.0 1.5 0.01
#pragma parameter gzg "Zoom Green" 1.01 1.0 1.5 0.01
#pragma parameter gzb "Zoom Blue" 1.0 1.0 1.5 0.01

And this is content deconvergence?

#pragma parameter goxr "Shift-X Red" 0.0 -1.0 1.0 0.01
#pragma parameter goyr "Shift-Y Red" -0.01 -1.0 1.0 0.01
#pragma parameter goxg "Shift-X Green" 0.0 -1.0 1.0 0.01
#pragma parameter goyg "Shift-Y Green" -0.01 -1.0 1.0 0.01
#pragma parameter goxb "Shift-X Blue" 0.0 -1.0 1.0 0.01
#pragma parameter goyb "Shift-Y Blue" 0.0 -1.0 1.0 0.01

Sorry I’m just trying to figure this out.

No, Shift is for horizontal or vertical deconvergence (content and glass with offset). While Zoom is scale type deconvergence from the center (also with offset). Both are masked out from the center if Refl. Fresnel (reflection-out) is not zeroed, otherwise the glass inner reflection is shown equally. I use Shift and Fresnel 0 for handhelds for example.

The plain Zoom and Shift (without RGB) are global offsets. So if you configured each RGB deconvergence individually but still want to add 0.05 to all three of them, use plain Zoom.

1 Like

I figured it out, I need to spend more time reading things, lol.

What kind of deconvergence are you using (linear?) or radial or something else? I’m kind of a fan of radial deconvergence personally.

1 Like

This is pretty good for creating your own LUT. Obviously, you need to be able to calibrate your display using a colorimeter.

If you don’t own a colorimeter, having a generic transformation is the next best thing if you have a wide gamut monitor.

5 Likes

Yes, it’s radial. I admit currntly it’s a little bit convoluted so I will try to tidy up the settings and names in the following days.

@c9f5fdda06 Yes, that’s what I use to calibrate and profile, superb software. For retroarch you have to use the Reshade preset. The tests I did a month ago weren’t satisfactory and hence now I’m using a matrix transform, but I will try again in the following days.

2 Likes

Is the LUT actually applied in true fullscreen applications (like Retroarch in non-windowed full screen)? Or only to Windowed and Fullscreen Windowed?

I’ve been using venom luts for a while in exclusive fullscreen, using his LUT shader or my implementation in grade.

2 Likes

Great that should work indeed. Did you save your LUTs as 1D or 3D ones, or wouldn’t it matter for the purpose here?

3D LUTs (64 depth), 1D LUTs are shapers for function transforms only.

1 Like

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.