New CRT shader from Guest + CRT Guest Advanced updates

Is it possible to add the overscan option also to the fast presets? Or would it slow down the shader? (It’s kinda hard to imagine that it would though.)

2 Likes

Will be added in the next release. Also need to fix some things…

4 Likes

New Release Version (2022-01-27-r1):

Notable changes:

  • Overscan options added to fast, fast-ntsc and hd versions
  • scanline saturation parameter range increased (for stronger mask falloff/decay)
  • scanline falloff parameter added

Download link:

https://mega.nz/file/gkwiQKhK#MxdXdvGjjsCDuXjZ9hn2UvKGCl1FNMofxOCk8r431tQ

11 Likes

I also created a preset which utilizes recently added features. I guess it should go nicely with 16-bit systems, as it prefers a richer color environment.

shaders = "12"
shader0 = "shaders_slang/crt-guest-advanced/shaders/guest/advanced/stock.slang"
filter_linear0 = "false"
wrap_mode0 = "clamp_to_border"
mipmap_input0 = "false"
alias0 = ""
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-guest-advanced/shaders/guest/advanced/stock.slang"
filter_linear1 = "false"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = "StockPass"
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-guest-advanced/shaders/guest/advanced/afterglow0.slang"
filter_linear2 = "false"
wrap_mode2 = "clamp_to_border"
mipmap_input2 = "false"
alias2 = "AfterglowPass"
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-guest-advanced/shaders/guest/advanced/pre-shaders-afterglow.slang"
filter_linear3 = "false"
wrap_mode3 = "clamp_to_border"
mipmap_input3 = "true"
alias3 = "PrePass"
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-guest-advanced/shaders/guest/advanced/avg-lum.slang"
filter_linear4 = "true"
wrap_mode4 = "clamp_to_border"
mipmap_input4 = "true"
alias4 = "AvgLumPass"
float_framebuffer4 = "false"
srgb_framebuffer4 = "false"
scale_type_x4 = "source"
scale_x4 = "1.000000"
scale_type_y4 = "source"
scale_y4 = "1.000000"
shader5 = "shaders_slang/crt-guest-advanced/shaders/guest/advanced/linearize.slang"
filter_linear5 = "true"
wrap_mode5 = "clamp_to_border"
mipmap_input5 = "false"
alias5 = "LinearizePass"
float_framebuffer5 = "true"
srgb_framebuffer5 = "false"
scale_type_x5 = "source"
scale_x5 = "1.000000"
scale_type_y5 = "source"
scale_y5 = "1.000000"
shader6 = "shaders_slang/crt-guest-advanced/shaders/guest/advanced/gaussian_horizontal.slang"
filter_linear6 = "true"
wrap_mode6 = "clamp_to_border"
mipmap_input6 = "false"
alias6 = ""
float_framebuffer6 = "true"
srgb_framebuffer6 = "false"
scale_type_x6 = "absolute"
scale_x6 = "800"
scale_type_y6 = "source"
scale_y6 = "1.000000"
shader7 = "shaders_slang/crt-guest-advanced/shaders/guest/advanced/gaussian_vertical.slang"
filter_linear7 = "true"
wrap_mode7 = "clamp_to_border"
mipmap_input7 = "false"
alias7 = "GlowPass"
float_framebuffer7 = "true"
srgb_framebuffer7 = "false"
scale_type_x7 = "absolute"
scale_x7 = "800"
scale_type_y7 = "absolute"
scale_y7 = "600"
shader8 = "shaders_slang/crt-guest-advanced/shaders/guest/advanced/bloom_horizontal.slang"
filter_linear8 = "true"
wrap_mode8 = "clamp_to_border"
mipmap_input8 = "false"
alias8 = ""
float_framebuffer8 = "true"
srgb_framebuffer8 = "false"
scale_type_x8 = "absolute"
scale_x8 = "800"
scale_type_y8 = "absolute"
scale_y8 = "600"
shader9 = "shaders_slang/crt-guest-advanced/shaders/guest/advanced/bloom_vertical.slang"
filter_linear9 = "true"
wrap_mode9 = "clamp_to_border"
mipmap_input9 = "false"
alias9 = "BloomPass"
float_framebuffer9 = "true"
srgb_framebuffer9 = "false"
scale_type_x9 = "source"
scale_x9 = "1.000000"
scale_type_y9 = "source"
scale_y9 = "1.000000"
shader10 = "shaders_slang/crt-guest-advanced/shaders/guest/advanced/crt-guest-advanced.slang"
filter_linear10 = "true"
wrap_mode10 = "clamp_to_border"
mipmap_input10 = "false"
alias10 = ""
float_framebuffer10 = "false"
srgb_framebuffer10 = "false"
scale_type_x10 = "viewport"
scale_x10 = "1.000000"
scale_type_y10 = "viewport"
scale_y10 = "1.000000"
shader11 = "shaders_slang/crt-guest-advanced/shaders/guest/advanced/deconvergence.slang"
filter_linear11 = "true"
wrap_mode11 = "clamp_to_border"
mipmap_input11 = "false"
alias11 = ""
float_framebuffer11 = "false"
srgb_framebuffer11 = "false"
scale_type_x11 = "viewport"
scale_x11 = "1.000000"
scale_type_y11 = "viewport"
scale_y11 = "1.000000"
CS = "2.000000"
TNTC = "1.000000"
WP = "-75.000000"
wp_saturation = "1.150000"
SIZEHB = "3.000000"
SIGMA_HB = "0.750000"
SIZEVB = "3.000000"
SIGMA_VB = "0.750000"
bloom = "0.900000"
halation = "0.100000"
gamma_c = "1.500000"
brightboost = "1.000001"
brightboost1 = "1.000000"
gsl = "2.000000"
scanline1 = "4.000000"
scanline2 = "10.000000"
beam_min = "2.799999"
beam_max = "0.775000"
beam_size = "0.750000"
scans = "1.650000"
scan_falloff = "0.650000"
spike = "1.500000"
h_sharp = "3.000002"
s_sharp = "1.000000"
sth = "0.300000"
csize = "0.115000"
bsize1 = "0.300000"
warpX = "0.040000"
warpY = "0.050000"
shadowMask = "6.000000"
maskstr = "0.900000"
mask_gamma = "2.399999"
mclip = "0.000000"
gamma_out = "2.200000"
deconrry = "1.250000"
deconrby = "-1.250000"
decons = "1.400000"
textures = "SamplerLUT1;SamplerLUT2;SamplerLUT3;SamplerLUT4"
SamplerLUT1 = "shaders_slang/crt-guest-advanced/shaders/guest/advanced/lut/trinitron-lut.png"
SamplerLUT1_linear = "true"
SamplerLUT1_wrap_mode = "clamp_to_border"
SamplerLUT1_mipmap = "false"
SamplerLUT2 = "shaders_slang/crt-guest-advanced/shaders/guest/advanced/lut/inv-trinitron-lut.png"
SamplerLUT2_linear = "true"
SamplerLUT2_wrap_mode = "clamp_to_border"
SamplerLUT2_mipmap = "false"
SamplerLUT3 = "shaders_slang/crt-guest-advanced/shaders/guest/advanced/lut/nec-lut.png"
SamplerLUT3_linear = "true"
SamplerLUT3_wrap_mode = "clamp_to_border"
SamplerLUT3_mipmap = "false"
SamplerLUT4 = "shaders_slang/crt-guest-advanced/shaders/guest/advanced/lut/ntsc-lut.png"
SamplerLUT4_linear = "true"
SamplerLUT4_wrap_mode = "clamp_to_border"
SamplerLUT4_mipmap = "false"
4 Likes

What does it do? :stuck_out_tongue:

2 Likes

Especially when using greater range between Scanline Shape Dark Pixels and Scanline Shape Bright Pixels parameters it can be now controlled how quick they are getting thinner.

For example, the ‘dark thinning’ can be very narrow now, but if the Scanline Falloff parameter is adjusted/decreased, the general coverage of the screen is still good enough.

This is just one example of the usage, the parameter can be used to achieve scanline beam dynamics which previously eluded control of the user.

4 Likes

If anyone is interested, the crt-guest-advanced-hd preset with the following options gives really great results in DOS games, both for VGA (200p/240p) as well as SVGA (400p/480p), at least with my 1440p display. I think 1080p users are out of luck? :stuck_out_tongue:

#reference "../../shaders/crt-guest-advanced/crt-guest-advanced-hd.slangp"
interm = "0.000000"
bloom = "0.100000"
halation = "0.025000"
brightboost = "1.100000"
shadowMask = "3.000000"
maskDark = "0.800000"
maskLight = "1.200000"

A posted some screenshots in this post.

3 Likes

I have a 4k HDR tv that has a pretty high peak brightness. I used mask 6 at 90% strength. I’m not sure what to expect as I never had a 50 inch CRT.

3 Likes

At 4k you can use last two masks, depending if you dot matrix is RGB or BGR. For some color-play and beam dynamics you can definitely play a bit with deconvergence and scanline saturation. Adding slotmask with the 4x1 setting could also be interesting. Also mask 4.0… :grin:

At mentioned resolution tweaking looks a bit different (=more viable options). I’m also sure that mega bezel shines on a large 4k display.

2 Likes

BTW is mask 8 supposed to be left at mask size 1 for 4k? :thinking:

1 Like

Mask 8 looks nice with size 1.0 at 1080p, so it would look more or less similar with 4k and size 2.0.

1 Like
color temp -50
glow 0.05
scanline beam 6-10
scanline dark 1
scanline bright 0.8
scanline fall off 0.50
mask 6
mask strength 0.5
sharpness 4.5

Not far from my Trinitron. Still blue has somehow more intense scanlines than green there. And is brighter than shown here.

3 Likes

@guest.r have a look at these

while on my shader

vec4 saturation (vec4 textureColor)
{
    vec3 luminanceWeighting = vec3(0.28, 0.54, 0.18);
    float luminance = dot(textureColor.rgb, luminanceWeighting);
    vec3 greyScaleColor = vec3(luminance);

    vec4 res = vec4(mix(greyScaleColor, textureColor.rgb, SATURATION),1.0);
    return res;
}

......

main()
.....
....
color = saturation(color);

shows

3 Likes

Yeah, i’m using different luma coefficients, which decrease blue’s influence by like 2.5x compared with your setup.

It’s (0.2126, 0.7152, 0.0722) vs. (0.28, 0.54, 0.18).

There’s basically no right or wrong here, but i might promote blue to 0.11. :grin:

2 Likes

It was the same but i adjusted them so they are displayed properly on grayscale lol.

2 Likes

Mask 11 works out for my BGR TV. 9 has no mask no matter what scale I put it at.

It’s fun to crank up the masks to near 100 percent and still have everything bright and vibrant. Mask 4 is very nice as well: (Snaps of my HDR TV)

7 Likes

@guest.r

Seems the real relationship is something like .4, .5, .1

From real Sony Trinitron. Then it’s strange how magenta is almost equal to cyan lol. What the hell lol. As per my measurements light is exponentially raised.if luminance is below 0.5 then it emits much less light e.g. 0.3 is 0.2 or something

Lame method to compensate

vec4 saturation (vec4 textureColor)
{
    float lum=length(textureColor.rgb)*0.5775;

vec3 luminanceWeighting = vec3(0.4,0.5,0.1);
if (lum<0.5) luminanceWeighting.rgb=(luminanceWeighting.rgb*luminanceWeighting.rgb)+(luminanceWeighting.rgb*luminanceWeighting.rgb);

    float luminance = dot(textureColor.rgb, luminanceWeighting);
    vec3 greyScaleColor = vec3(luminance);

    vec4 res = vec4(mix(greyScaleColor, textureColor.rgb, SATURATION),1.0);
    return res;
}

Or that could be wrong too lol.

1 Like

The monochrome option in ‘GDV’ is already using standard ntsc luma coeffs (0.299, 0.587, 0.114). I believe it’s an adequate option with which you can’t miss.

Otherwise the real crt output also depends on how you balance it’s settings like brightness, contrast and saturation…so results may vary.

If i crank down saturation to 0.0 within my gpu drivers strongly blue hues produce quite dark tones, so it’s something standard practices are cool with.

The interesting thing with blue (for example) is that it looks quite ‘blue’ even when mixed evenly with other two colors (while blue is still dominant). So it’s nothing to worry about because colors which look blue can produce a quite bright imprint.

3 Likes

This one is a bit puzzling. Mask 9 on my AMD gpu afaik looks the same as mask 8 on at least nVidia gpus. Mask 8 on my gpu darkens 2 pixels and leaves one as it is.

1 Like