Dogway's grading shader (slang)

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.

3 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

Yes, that’s right. Originally it should be along the hue axis, but for simplicity I left it at only red, green and blue hue values. EDITed out erroneous assumption.

There will be some influence since colors usually are not pure, and we don’t have a peak or notch width factor but as it is it’s cool to have this as a retroarch shader.

1 Like

About to test glass now, just finished messing around with grade. The only thing I have that could be a complaint is, I’d like the sat setting and the hue vs sat settings to go up by 0.01 instead of 0.02, that my only nitpick everything seemed fine and looked good on my end.

Tried a different white point then I had been using I was using 9k something, wasn’t super into the 6k you had as default so set it to 7.5k. The hue vs sat is interesting. (Haven’t really gotten too deep in that rabbit hole yet.)

EDIT: I’ve tested glass now, I’ve gotten a way better hand on how it does things now.

If I had a single complaint about the shader it’s that everything is tied to the reflection toggle, from my testing you shut off the reflection toggle and everything seems to stop functioning in glass, both the deconvergence and the afterglow stopped working if I shut off the reflection toggle.

1 Like

Hey, sorry for the delay. I changed the stepping. Actually is a dirty and cheap HUE vs Sat, because I didn’t have time to do anything else but I might revisit it with a proper HUE vs Sat.

On the temperature, when I changed it to a Bradford transform D93 was bluer than before, this works for me in 16 bit games, but everything else I use D75 as well like for CPS games.

You are true about the tying thing, I should see how to decouple every function. Basically my thought was if there’s no reflection, there’s no augmented deconverge… The content deconvergence was an afterthought to keep it compact instead of relying on other shaders for that. I’ll look into it.

1 Like

You’re fine it seems the forums have been down for the better part of the day anyway.

Thanks for changing the stepping I’m just being nitpicky, lol.

About temperature I remember you talking about changing it, I just don’t think I had updated since right before then (I may be wrong.) What is proper D75? As I think I have the temperature set at 7501 or something like that.

Mainly I’d be happy with the decoupling, if you could decouple the base deconvergence (not the zoom version, as the zoom deconvergence seems fine being tied to reflection. Might be harder to untie it this way though 🤷) from it, as well as the afterglow being decoupled. I haven’t looked everything over to see how feasible this is though.

I’m fine with everything that’s in glass being in a single shader, I’d just like to pick and choose my effects more liberally. (Again being nitpicky, I love Swiss army knife shaders. I just like being able to micromanage/power-user these effects.)

1 Like

I think afterglow is decoupled, the good thing of everything being in one shader is to reuse code, in glass the afterglow is also supposed to be seen in glass inner reflection, so that’s a good thing.

D75 is 7504 as I could check. I will be more intermitent from now on since I’ll doing other things, but from time to time I will try to look into glass as grade is finished (?). Might be tempted to add AdobeRGB space if enough users ask for it.

3 Likes

I’ll look over glass some and see if I can think of a way to reuse as much code as possible while still decoupling some things. (While keeping things coupled while both being active.)

1 Like

I want Adobe RGB, pls :slight_smile:

2 Likes

I’ve been experimenting some more with your presets and sugguestions. Would the following values be somewhat accurate?

  • green-blue: -0.10
  • blue-red: +0.06
  • blue-green: -0.09

I don’t understand why this looks better, but it does :slight_smile: (Testing with the PAL preset btw). Could you explain a bit why it are these specific changes that do most of the trick?

Also if I would calibrate my monitor to accurate sRGB profile, do I then don’t apply above measures anymore, or are they then still useful?

On the topic of calibration, I’m still a bit confused. Are the steps with DisplayCal as follows?

Option 1: Creating a new profile and 3D LUT

  1. Select the “Video 3D LUT for ReShade (Rec. 709 / 1886)” preset under “Settings”.

  2. On the “Profiling” tab, optionally increase the number of patches with the slider. More patches will yield higher accuracy of the resulting profile and 3D LUT.

  3. If desired, adjust the lookup table size on the “3D LUT” tab. Sizes 16x16x16, 32x32x32 and 64x64x64 are supported.

  4. Click “Calibrate & profile”. Adjust the whitepoint of your display if necessary, then continue on to profiling.

  5. Wait for measurements and calculations to finish.

How many patches are recommended for 2? And what size do I choose under 3 (64x64x64)?

If I then save the profile and I’m using your preset, do I then save the profile to the location of LUT2 ("…\reshade\shaders\LUT\64.png")?

Am I then set?

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”

2 Likes

Yes, more or less, it’s the opposite but you’re getting the same effect than me due to doing also blue to green. My settings before were like:

gb = "0.030000"
bg = "0.100000"

Red usually didn’t touch much because grade was already dealing with it. Now that I color managed retroarch, I can set the above to 0, and it looks same-ish or better. The reason is original palette are pure colors, primary colors which are very saturated, those are the first to go out of gamut on a display not 100% sRGB (most if not all them). As I could find out, compressing the gamut to display’s gamut seems to do similar crosstalk between primary colors as described above manually.

As for DisplayCAL, mostly everything is correct, I use a depth of 64, and the number of patches depends on your patience and your colorimeter. With my current one I can do 115 or 175 just fine.

There’s one caveat though, I haven’t managed to use LUTs made out of DisplayCAL, and I think it’s because I’m messing with gamma ramps (Calibration - Tone Curve -not As Measured-), this is supposed to be ignored if you untick Apply calibration (vcgt), but I haven’t had much luck with it. My alternative is just picking the calibration matrix and doing the transforms to finally add as it was an additional Color Space matrix. If you have the opportunity to calibrate the display and have following issues just let me know.

3 Likes

Are you now recommending D75 and no color tinting when using a calibrated color profile?

I get clipped blues if I set the temperature any higher than 6505. Is this normal?

Also, are you still recommending that we set CRT gamma to 2.2 when using an HDTV with a gamma of 2.4? Or has this changed?

2 Likes