New CRT shader from Guest + CRT Guest Advanced updates

you can see it with the blocks and the koopa troopas. They leave a trail after they scroll.

Pretty sure it’s the afterglow. The thing that hunter said.

@lilbud As the others said, it’s the afterglow feature in guest-venom. It’s supposed to simulate phosphor decay from real CRT, but this is inherently difficult to simulate (it would need a Retroarch update that provides more than 10x the history of frames to the shader then it is currently doing)

But anyway, since the others did not point you to it and you seem somewhat inexperienced with testing parameters. You can disable the effect by setting “Afterglow strength” to 0.00. Good luck!

I mean I assumed when we pointed out the issue it’d be fairly obvious.

1 Like

I know mate, but he doesn’t seem well versed into this stuff and it would be a pitty if he would dislike the excellent shader for it.

2 Likes

It’s very old behavior, afterglow was introduced since very early 2018 versions. After the rework it’s more sophisticated though, but the default settings are similar to old ones. I’m very interested if someone finds a regression or similar, it’s somewhat important to compare it with the official repository version though.

1 Like

I’ll try and not be a lazy sack o’ shit sometime this week and check it out, as not to toot my own horn but besides you, nesguy and hyperspinmadness, I’m probably one of the people most well versed in how your shader works (both parameters and on a code level.)

1 Like

New crt-guest-dr-venom2 release versions:

I have been working on the shaders somewhat more and i think some features work nicer now.

Here are the changes compared with the previous ‘new’ version:

  • global desaturation (saturation parameter range 0.0-1.0) works much nicer now
  • color temperature uses D93 and D50 as endpoints now for better effect consistency
  • minor lut tweaks, a color profile bug corrected
  • integer scaling isn’t smart any more, user can select between lower and higher scale factor manually (plus horizontal aspect correction)
  • mask8 added as described by Nesguy
  • trinitron masks 5&6 are more appealing now
  • bloom tweaked a bit
  • in the presets (following the instruction) ‘linearize pass buffer’ can be forced to higher precision, usable if using input gamma above 3.0
  • glow passes weights normalized and minor correctures
  • last but not least, interlace-scanline features for hires and ntsc versions now use internal resolution as reference instead of integer scaline mode, old implementation was a bit ‘scarry’.

Download link:

https://mega.nz/file/Fg5EnRSL#AE08sZnngrfRDGMuhHjXh-J2weDuoFN00i49mP_lwkQ

Edit: minor update

Edit2: LUT1 fixed…

8 Likes

Your CRT shader is quite sophisticated. For example, I like the bloom effect, it’s a differentiator.

2 Likes

What mask do you recommend to 1080p and what is your videos settings?

1 Like

I really recommend mask 8 (just added) for 1080p. After using slot masks for a while it’s very apparent how much better aperture grille is at 1080p.

I pasted my current settings below. Let me know if these settings work for you, gamma on my display is kinda weird though.

Guest posted some settings about a hundred posts up, I found they resulted in the black level being very high but you might get some ideas.

shaders = "7"
shader0 = "shaders_slang/misc/grade.slang"
filter_linear0 = "false"
wrap_mode0 = "clamp_to_border"
mipmap_input0 = "false"
alias0 = "StockPass"
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/crt/shaders/guest/crt-gdv-new/afterglow0.slang"
filter_linear1 = "false"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = "AfterglowPass"
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/crt/shaders/guest/crt-gdv-new/pre-shaders-afterglow.slang"
filter_linear2 = "false"
wrap_mode2 = "clamp_to_border"
mipmap_input2 = "false"
alias2 = "LinearizePass"
float_framebuffer2 = "true"
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/crt-gdv-new/avg-lum.slang"
filter_linear3 = "true"
wrap_mode3 = "clamp_to_border"
mipmap_input3 = "true"
alias3 = "AvgLumPass"
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/crt-gdv-new/blur_horiz2.slang"
filter_linear4 = "true"
wrap_mode4 = "clamp_to_border"
mipmap_input4 = "false"
alias4 = ""
float_framebuffer4 = "true"
srgb_framebuffer4 = "false"
scale_type_x4 = "absolute"
scale_x4 = "800"
scale_type_y4 = "source"
scale_y4 = "1.000000"
shader5 = "shaders_slang/crt/shaders/guest/crt-gdv-new/blur_vert2.slang"
filter_linear5 = "true"
wrap_mode5 = "clamp_to_border"
mipmap_input5 = "false"
alias5 = "GlowPass"
float_framebuffer5 = "true"
srgb_framebuffer5 = "false"
scale_type_x5 = "absolute"
scale_x5 = "800"
scale_type_y5 = "absolute"
scale_y5 = "600"
shader6 = "shaders_slang/crt/shaders/guest/crt-gdv-new/crt-guest-dr-venom2.slang"
filter_linear6 = "true"
wrap_mode6 = "clamp_to_border"
mipmap_input6 = "false"
alias6 = ""
float_framebuffer6 = "false"
srgb_framebuffer6 = "false"
scale_type_x6 = "viewport"
scale_x6 = "1.000000"
scale_type_y6 = "viewport"
scale_y6 = "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_vibr;g_satr;g_satg;g_satb;g_lift;blr;blg;blb;wlr;wlg;wlb;rg;rb;gr;gb;br;bg;LUT_Size1;LUT1_toggle;LUT_Size2;LUT2_toggle;PR;PG;PB;AS;sat;TNTC;CP;CS;WP;wp_saturation;GAMMA_INPUT;lsmooth;SIZEH;GLOW_FALLOFF_H;SIZEV;GLOW_FALLOFF_V;glow;bloom;TATE;IOS;OS;BLOOM;gamma_c;brightboost;brightboost1;gsl;scanline1;scanline2;beam_min;beam_max;beam_size;vertmask;scans;spike;h_sharp;s_sharp;csize;bsize;warpX;warpY;shadowMask;masksize;maskDark;maskLight;CGWG;mcut;slotmask;slotwidth;double_slot;slotms;mclip;inter;interm;gamma_out"
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 = "0.000000"
g_vstr = "40.000000"
g_vpower = "0.200000"
g_lum = "0.000000"
g_cntrst = "0.000000"
g_mid = "0.500000"
wp_temperature = "8005.000000"
g_sat = "0.000000"
g_vibr = "0.000000"
g_satr = "0.000000"
g_satg = "0.000000"
g_satb = "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.000000"
LUT_Size1 = "16.000000"
LUT1_toggle = "0.000000"
LUT_Size2 = "64.000000"
LUT2_toggle = "0.000000"
PR = "0.140000"
PG = "0.140000"
PB = "0.140000"
AS = "0.080000"
sat = "0.100000"
TNTC = "0.000000"
CP = "0.000000"
CS = "0.000000"
WP = "0.000000"
wp_saturation = "1.000000"
GAMMA_INPUT = "2.400000"
lsmooth = "0.900000"
SIZEH = "4.000000"
GLOW_FALLOFF_H = "0.300000"
SIZEV = "4.000000"
GLOW_FALLOFF_V = "0.300000"
glow = "0.000000"
bloom = "0.000000"
TATE = "0.000000"
IOS = "0.000000"
OS = "1.000000"
BLOOM = "0.000000"
gamma_c = "1.000000"
brightboost = "1.000000"
brightboost1 = "1.500000"
gsl = "0.000000"
scanline1 = "6.000000"
scanline2 = "18.000000"
beam_min = "1.999999"
beam_max = "1.000000"
beam_size = "1.000000"
vertmask = "0.000000"
scans = "1.000000"
spike = "0.000000"
h_sharp = "3.000001"
s_sharp = "1.000000"
csize = "0.000000"
bsize = "600.000000"
warpX = "0.000000"
warpY = "0.000000"
shadowMask = "8.000000"
masksize = "1.000000"
maskDark = "0.500000"
maskLight = "1.000000"
CGWG = "0.500000"
mcut = "1.150000"
slotmask = "0.000000"
slotwidth = "2.000000"
double_slot = "1.000000"
slotms = "1.000000"
mclip = "0.500000"
inter = "350.000000"
interm = "1.000000"
gamma_out = "2.400000"
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"
1 Like

It’s a feature but like rafan said, you need at least black frame insertion.

1 Like

I’m getting nice results from your new shader. I found it’s easier to deal with colors after I removed the grade pass. Lut 1 is has very odd almost monochromatic color and lut 3 causes black artifacts, which if I recall, is a problem with 1650 gpu. Temperature is very tricky to get right and not have it blow out details in the brights.

3 Likes

I think the ease of using grade depends on what you’re actually try to do with the color management.

2 Likes

I think Venom 2 might have some overlapping or conflicting color and gamma issues with grade. I could be wrong but I felt like I wasn’t getting as good as results with it as before.

1 Like

Could you post the 240p test suite color bars with ver. 2 and grade + lut’s?

I’m getting:

LUT1:

LUT2:

LUT3:

Lower res. is OK. I’m getting nice results though, perhaps it’s fixable although i’d had to guess a bit.

And also grade + problematic color temperature. But there is really no need to use both functionalities though.

grade + color temp -100%

Also very important, to start a new setup with the newest version, from the given folder. The folder can be renamed though.

Unfortunately this update breaks the support for LUTs with size 64.0 :frowning: I’m getting discontinuities in blue. See (scaled down) image of Super Aleste title screen below:

Super Aleste (J)

Btw, I’m using DisplayCAL 3D luts for Reshade as per Dogway’s suggestion for using screen calibration profile in RA full screen mode.

//#define LUT_Size 32.0
#define LUT_Size 64.0

This used to work with previous versions of your shader (either with lut.slang as separate pass or with it incorporated in the prepass). It also works with grade.slang correctly (which has configurable size for luts).

Could you possibly test your updates also with a lut size 64.0? I know your two luts are specific to the shader, but it’s immensely useful to be able to use the DisplayCAL 3D Luts for reshade.

Too little info. I didn’t change the lookup code, only customized the adjustments a bit after the lut is read. There are two ways to use other custom lut’s:

  1. increase the parameter range and add lut there.

or

  1. wipe clean the if-else lut section after the line:

res = mixfix(color1, color2, mixer);

because the correctures are lut specific.

I’m not sure what you mean I should do:

I have the following custom lut in my preset:

SamplerLUT2 = "shaders_slang/crt/shaders/guest/lut/displayCAL-2.2.png"

TNTC = "2.000000"

then in the prepass I have changed the #define LUT_Size 32.0 to #define LUT_Size 64.0

Given the above, what should I wipe out from the code below, or better what should I keep?

   if (int(TNTC) == 0)
   {
      color.rgb = color.rgb;
   }
   else
   {
      float red = ( imgColor.r * (LUT_Size - 1.0) + 0.499999 ) / (LUT_Size * LUT_Size);
      float green = ( imgColor.g * (LUT_Size - 1.0) + 0.499999 ) / LUT_Size;
      float blue1 = (floor( imgColor.b  * (LUT_Size - 1.0) ) / LUT_Size) + red;
      float blue2 = (ceil( imgColor.b  * (LUT_Size - 1.0) ) / LUT_Size) + red;
      float mixer = clamp(max((imgColor.b - blue1) / (blue2 - blue1), 0.0), 0.0, 32.0);
      vec4 color1, color2, res;
      if (int(TNTC) == 1)
      {
         res = mixfix(color1, color2, mixer);
         float mx = max(res.r,max(res.g,res.b));
         float l = mix(length(imgColor.rgb), length(res.rgb), max(mx-0.5,0.0));
         res.rgb = mix(imgColor.rgb, res.rgb, clamp(25.0*(mx-0.02),0.0,1.0));
         res.rgb = normalize(res.rgb+1e-10)*l;
      }
      else if (int(TNTC) == 2)
      {
         color1 = COMPAT_TEXTURE( SamplerLUT2, vec2( blue1, green ));
         color2 = COMPAT_TEXTURE( SamplerLUT2, vec2( blue2, green ));
         res = mixfix(color1, color2, mixer);
		 res.rgb = lift(color, res.rgb);
      }	
      else if (int(TNTC) == 3)
      {
         color1 = COMPAT_TEXTURE( SamplerLUT3, vec2( blue1, green ));
         color2 = COMPAT_TEXTURE( SamplerLUT3, vec2( blue2, green ));
         res = mixfix(color1, color2, mixer);
         res.rgb = pow(res.rgb, vec3(1.0/1.20));
         float mx = max(res.r,max(res.g,res.b));
         res.rgb = mix(imgColor.rgb, res.rgb, clamp(25.0*(mx-0.05),0.0,1.0));		
         float l = length(imgColor.rgb);
         res.rgb = normalize(res.rgb + 1e-10)*l;
      }	
      
      color = mix(imgColor.rgb, res.rgb, min(TNTC,1.0));
   }
1 Like

There is indeed a bug that didn’t get picked up, but it doesn’t involve LUT2.

You should change:

else if (int(TNTC) == 2)
      {
         color1 = COMPAT_TEXTURE( SamplerLUT2, vec2( blue1, green ));
         color2 = COMPAT_TEXTURE( SamplerLUT2, vec2( blue2, green ));
         res = mixfix(color1, color2, mixer);
         res.rgb = lift(color, res.rgb);
      }

into

else if (int(TNTC) == 2)
      {
         color1 = COMPAT_TEXTURE( SamplerLUT2, vec2( blue1, green ));
         color2 = COMPAT_TEXTURE( SamplerLUT2, vec2( blue2, green ));
         res = mixfix(color1, color2, mixer);
      }	

though.