New CRT shader from Guest + CRT Guest Advanced updates

@guest.r

I think we talked about the scanline shape, which is about perfect, and I think you already said it’s about as good as it gets. So disregard below if this was already answered. Just want to make sure whether it would be possible to have one aspect of the scanline dynamics better configurable. (If not maybe if ever for GDV3 :smiley: )

See picture below of the four scanline types in your shader (from your default preset with increased bright scanline beam at “0”).

It seems the most distuingishing difference between scanline types -1, 0, 1 and 2 is the (perceptual) “ratio” in scanline thickness/height of bright versus dark parts? I.e. how much thicker/higher is the bright part of a scanline versus how much thinner is the dark scanline part?

gaussianprofile-thick-thin

If so, would it be possible to make that ratio configurable?

For example a setting of “0” would mean the bright part scanline thickness would be equal to dark part scanline thickness and a setting of 1 would mean maximum difference in scanline thickness for bright versus dark parts.

On real CRT it probably depends on tv and monitor model (specs, aging, maintenance etc.) how much bright scanline grows over dark scanline in height, and I would really love to have that little bit more control over this ratio.

1 Like

It’s some more correcting required, basically all the numbers below the shaders names and paths too (example for pass 5):

shader5 = shaders/guest/crt-gdv-new/avg-lum.slang

filter_linear5 = true

scale_type5 = source

scale5 = 1.0

mipmap_input5 = true

alias5 = AvgLumPass

It should be already configurable. You can get about ‘even’ scanlines by making Scanline Shape Dark Pixels and Scanline Shape Bright Pixels about the same value with scanline types -1.0 and 0.0. Types 1.0 and 2.0 are more difference oriented for narrower beams with darker pixels.

Values for ‘Dark Pixles’ can also be lower than for bright pixels.

2 Likes

Unfortunately it fails to load still. I did the above and checked it over a few times to make sure I did it correctly but it’s not having any of it, sadly.

Put SMAA back in it’s default directory, and corrected paths too.

I am using a slightly older version (5-6 weeks), but I tried your newest release just in case, but it still happens.

:frowning:

If you get some time, would you mind throwing a version (default version) up with 3 passes at the start of the shader that I can put the SMAA in. Cheers.

1 Like

Thanks, that seems to work quite OK for grayscale values (the dark grey versus bright white pixel contrasts), but for white-vs-(saturated)color values I can’t seem to achieve the about ‘even’ scanlines" look without using extreme values causing other artifacts.

Below is the 320x240 testimage I’m using with a raw cutout from a game multiplied a few times. Could you test this in the imageviewer and see if it does what you want when trying to achieve the about ‘even’ look? Of course in the end I don’t want the about even look permanently, but I would like to work from there to create a super subtle increased bright scanline thickness over darker (saturated) colors.

whitepixelbulged3

1 Like

You can also try the Scanline Beam Shape Center and Scanline Beam Shape Edges parameters (renamed since last few versions) with good results. To have acceptable results the ‘center’ value has to be lowered and the ‘edges’ value raised.

Edit: the blue color component luma value is also the lowest of all three and therefore the perceptive contribution is to be considered also.

Probably not in the official version, but you can use this as a template with the newest version:

shaders = 13

shader0 = shaders/guest/crt-gdv-new/stock.slang
filter_linear0 = false
scale_type0 = source
scale0 = 1.0
alias0 = StockPassA

shader1 = shaders/guest/crt-gdv-new/stock.slang
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
alias1 = StockPassB

shader2 = shaders/guest/crt-gdv-new/stock.slang
filter_linear2 = false
scale_type2 = source
scale2 = 1.0
alias2 = StockPass

shader3 = shaders/guest/crt-gdv-new/afterglow0.slang
filter_linear3 = false
scale_type3 = source
scale3 = 1.0
alias3 = AfterglowPass

shader4 = shaders/guest/crt-gdv-new/pre-shaders-afterglow.slang
filter_linear4 = false
scale_type4 = source
scale4 = 1.0
alias4 = PrePass

textures = "SamplerLUT1;SamplerLUT2;SamplerLUT3;SamplerLUT4"
SamplerLUT1 = shaders/guest/lut/sony_trinitron1.png
SamplerLUT1_linear = true 
SamplerLUT2 = shaders/guest/lut/sony_trinitron2.png
SamplerLUT2_linear = true 
SamplerLUT3 = shaders/guest/lut/other1.png
SamplerLUT3_linear = true
SamplerLUT4 = shaders/guest/lut/custom_lut.png
SamplerLUT4_linear = true

shader5 = shaders/guest/crt-gdv-new/avg-lum.slang
filter_linear5 = true
scale_type5 = source
scale5 = 1.0
mipmap_input5 = true
alias5 = AvgLumPass

shader6 = shaders/guest/crt-gdv-new/linearize.slang
filter_linear6 = true
scale_type6 = source
scale6 = 1.0
alias6 = LinearizePass
float_framebuffer6 = true

shader7 = shaders/guest/crt-gdv-new/gaussian_horizontal.slang
filter_linear7 = true
scale_type_x7 = viewport
scale_x7 = 0.5
scale_type_y7 = source
scale_y7 = 1.0 
float_framebuffer7 = true

shader8 = shaders/guest/crt-gdv-new/gaussian_vertical.slang
filter_linear8 = true
scale_type_x8 = viewport
scale_x8 = 0.5
scale_type_y8 = viewport
scale_y8 = 0.5
float_framebuffer8 = true
alias8 = GlowPass

shader9 = shaders/guest/crt-gdv-new/bloom_horizontal.slang
filter_linear9 = true
scale_type_x9 = source
scale_x9 = 1.0
scale_type_y9 = source
scale_y9 = 1.0 
float_framebuffer9 = true

shader10 = shaders/guest/crt-gdv-new/bloom_vertical.slang
filter_linear10 = true
scale_type_x10 = source
scale_x10 = 1.0
scale_type_y10 = source
scale_y10 = 1.0
float_framebuffer10 = true
alias10 = BloomPass

shader11 = shaders/guest/crt-gdv-new/crt-guest-dr-venom2.slang
filter_linear11 = true
scale_type11 = viewport
scale_x11 = 1.0
scale_y11 = 1.0

shader12 = shaders/guest/crt-gdv-new/deconvergence.slang
filter_linear12 = true
scale_type12 = viewport
scale_x12 = 1.0
scale_y12 = 1.0
3 Likes

Many thanks

Unfortunately it still doesn’t work, so I believe it must be to do with the SMAA shader itself. Not a lot that can be done.

Appreciate the help though.

1 Like

you can find out why a shader is failing by looking at log output. Verbose/debug logs contain shader compiler errors.

Re: 1:1 scanlines, I guess I’m missing the point of why you would want to do that in GDV when that’s what any simple scanline shader, like ‘scanline.slang’, already does. :stuck_out_tongue: That is, a lot of GDV’s magic is in doing exactly not that lol

3 Likes

I’ve been playing around with the new gdv shader lately. Compared to the original gdv shader (the first gen, without spike removal, scanline saturation, etc), this seems to be intended for more advanced users. I can still get some very nice looking results with the new gdv shader but the paint point for me is definitely color. With the first gen gdv shader, after creating a good-looking preset, it was easy to create some variations on top of it with different scanline and mask characteristics. All I needed to do was probably bump or lower the brightness/saturation a bit.

With the new GDV shader, the scanline/brightness parameters seem to affect the colors way more dramatically than the first gen gdv so it’s now a lot easier for a noob like me to totally screw up the colors when fine-tuning other parameters. No doubt the shader has become much more powerful and can now mimic crt behaviours much more accurately. The things I miss from the first gen gdv are: 1) PVM colors. This has probably been replaced by the scanline deconvergence. IMO the old PMV effect looked more vibrant and authentic. Slot mask also looked nicer with PMV colors in dark parts of the picture (more pronounced, good looking deconvergence) 2) easier color/brightness manipulation. Probably not possible at this point since we now have a variety of color/brightness options and controls so I can see this is by design.

Thank you for your great work!

1 Like

I haven’t been using the gdv shader, but in my experience, the brightness settings always wreck the colors. I’m currently fine-tuning some presets with the following settings if can you can derive any value from them.

Mask 6

Mask Strength 0.00

Mak 5-7 Low Strength 0.50

Glow 0.25

Halation 0.15

Bright Boost Bright 1.00

Gamma Input 3.00

Gamma Output 3.00

2 Likes

No worries, this went the other way around in fact regarding colors/saturation and also brightness -> That’s why i implemented the ‘Gamma correct’ parameter as a really quick fix for using stronger scanlines and trinitron masks. Former implementations had a lot of auto-corrections, which isn’t the best solution since people use different display technologies with different settings etc.

The effect itself can be stronger now. Before it really widened the scanlines to look good, which isn’t always nice, especially with scanline type 1&2.

Gamma correct fixes it most of the times. Bloom, glow and halation are really optional. Overall it isn’t that demanding since you can focus on one aspect of the shader at time. Mostly, the feel is too dark with the scanline type 2 and trinitron masks combo and slotmask, but this won’t/shouldn’t be altered.

1 Like

Thanks for the explanation! Is it possible to re-create the previous PVM effect (I used to set it at around 15) with current deconvergence parameters? Probably not but I had to ask :frowning_face:

The main difference between PMV colors and the scanline deconvergence is that sometimes I actually couldn’t see the deconvergence effect (if any) especially in the parts covered by stronger vertical masks. With the 1st gen gdv, the PVM effect is almost always visible. I could always see pronounced red deconvergence in those darker pixels (liked that a lot!) when using slotmask, and the scanlines looked more vibrant. Now the scanline deconvergence effect at maximum strength (1) is somewhere between somewhat noticeable and completely invisible to me. Good to hear that the effect can be stronger now :smile:

1 Like

It could get stronger and more consistent. But i guess i should tweak it a bit. Former implementation isn’t possible any more though with the new version.

1 Like

@guest.r

The newpixie-crt shader gives me the impression that a picture was taken from a real monitor, that there is glass on the screen.

Could you reproduce this more realistic effect on your shader? A glass screen effect?

newpixie-crt

crt-guest-dr-venom2

Thanks.

1 Like

You can use deconvegnece options with crt-gdv too, but aren’t used on the screenshot. If i would remove the TATE effect, then even better deconvergence would be possible, for example, since i could do a multipass version with deconvergence before masks etc. But as i mentioned already, you can also use the fine glass shader from Dogway.

I gave up using TATE mode I can never get it to look how I think it should and I can just rotate the video and get what I feel looks better.

1 Like

Fast version can also be checked, it has different deconvergence implementation. From the retrospective, i think i’ll leave it unless maybe there will be pre-rotations implemented with arcade cores.

Those images inspired me to see if I could achieve a similar deconvergence with the NTSC shader. I ended up just using the default 1.0, but combined with another breakthrough with the mask and I think I may have achieved perfection.

shaders = "10"
shader0 = "shaders_slang/crt/shaders/guest/crt-gdv-new/stock.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 = ""
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/crt-gdv-new/ntsc/ntsc-pass1.slang"
filter_linear3 = "false"
wrap_mode3 = "clamp_to_border"
frame_count_mod3 = "2"
mipmap_input3 = "false"
alias3 = ""
float_framebuffer3 = "true"
srgb_framebuffer3 = "false"
scale_type_x3 = "source"
scale_x3 = "4.000000"
scale_type_y3 = "source"
scale_y3 = "1.000000"
shader4 = "shaders_slang/crt/shaders/guest/crt-gdv-new/ntsc/ntsc-pass2.slang"
filter_linear4 = "false"
wrap_mode4 = "clamp_to_border"
mipmap_input4 = "false"
alias4 = "PrePass"
float_framebuffer4 = "false"
srgb_framebuffer4 = "false"
scale_type_x4 = "source"
scale_x4 = "0.500000"
scale_type_y4 = "source"
scale_y4 = "1.000000"
shader5 = "shaders_slang/crt/shaders/guest/crt-gdv-new/avg-lum-ntsc.slang"
filter_linear5 = "true"
wrap_mode5 = "clamp_to_border"
mipmap_input5 = "true"
alias5 = "AvgLumPass"
float_framebuffer5 = "false"
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/crt-gdv-new/linearize-ntsc.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/crt-gdv-new/bloom_horizontal.slang"
filter_linear7 = "true"
wrap_mode7 = "clamp_to_border"
mipmap_input7 = "false"
alias7 = ""
float_framebuffer7 = "true"
srgb_framebuffer7 = "false"
scale_type_x7 = "viewport"
scale_x7 = "0.500000"
scale_type_y7 = "source"
scale_y7 = "1.000000"
shader8 = "shaders_slang/crt/shaders/guest/crt-gdv-new/bloom_vertical.slang"
filter_linear8 = "true"
wrap_mode8 = "clamp_to_border"
mipmap_input8 = "false"
alias8 = "GlowPass"
float_framebuffer8 = "true"
srgb_framebuffer8 = "false"
scale_type_x8 = "viewport"
scale_x8 = "0.500000"
scale_type_y8 = "viewport"
scale_y8 = "0.500000"
shader9 = "shaders_slang/crt/shaders/guest/crt-gdv-new/crt-guest-dr-venom2-ntsc.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"
PR = "0.150000"
PG = "0.150000"
PB = "0.150000"
AS = "0.020000"
sat = "1.000000"
lsmooth = "0.970000"
GAMMA_INPUT = "3.000000"
deconstr = "1.000000"
interm = "2.000000"
SIZEHB = "50.000000"
SIGMA_HB = "0.550000"
SIZEVB = "50.000000"
SIGMA_VB = "0.550000"
glow = "0.250000"
halation = "0.150000"
brightboost = "2.499999"
brightboost1 = "1.000000"
gsl = "1.000000"
scanline1 = "0.000000"
scanline2 = "12.000000"
beam_min = "1.000000"
beam_max = "0.900000"
vertmask = "1.000000"
scans = "0.000000"
h_sharp = "4.000001"
s_sharp = "0.600000"
OS = "0.000000"
BLOOM = "1.000000"
shadowMask = "6.000000"
maskstr = "0.500000"
masksize = "1.000000"
mcut = "0.500000"
slotmask = "0.500000"
slotwidth = "3.000000"
slotms = "1.000000"
mclip = "1.000000"
gamma_out = "2.999997"
textures = "SamplerLUT1;SamplerLUT2;SamplerLUT3;SamplerLUT4"
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"
SamplerLUT4 = "shaders_slang/crt/shaders/guest/lut/custom_lut.png"
SamplerLUT4_linear = "true"
SamplerLUT4_wrap_mode = "clamp_to_border"
SamplerLUT4_mipmap = "false"

The Slot and Mask sizes are set to 1.00 for 1080p. I personaly use a 4k monitor and set this to 2.00.

Also when I said I wasn’t using the “gdv shader” past me was being an idiot; my mind went to glsl.

2 Likes

I use TATE, it’s good, don’t listen to people who want to remove it. :imp:

5 Likes

I agree. Sadly, it doesn’t play nice with NTSC’s 4x horizontal upscale requirements.

1 Like

Yeah, TATE will remain an integral feature. :relaxed: No worries.

3 Likes