Please show off what crt shaders can do!

OK, but what parameter is Mask ? Is it Phosphor Layout, like CybeREX said ?

yes, it’s PHOSPHOR_LAYOUT. I think I’ll need to rename this param to be more easy to understand what it means.

1 Like

I kinda like Mask 10 on 1080p too, though.

I had to make a few adjustments, here are my current results.

shaders = "2"
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/hyllian-new.slang"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = "AfterglowPass"
float_framebuffer1 = "false"
srgb_framebuffer1 = "false"
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;BEAM_PROFILE;HFILTER_PROFILE;BEAM_MIN_WIDTH;BEAM_MAX_WIDTH;SCANLINES_STRENGTH;COLOR_BOOST;HFILTER_SHARPNESS;PHOSPHOR_LAYOUT;MASK_INTENSITY;CRT_ANTI_RINGING;InputGamma;OutputGamma;VSCANLINES"
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 = "7005.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"
BEAM_PROFILE = "0.000000"
HFILTER_PROFILE = "0.000000"
BEAM_MIN_WIDTH = "0.500000"
BEAM_MAX_WIDTH = "1.000000"
SCANLINES_STRENGTH = "0.420000"
COLOR_BOOST = "1.500000"
HFILTER_SHARPNESS = "1.000000"
PHOSPHOR_LAYOUT = "4.000000"
MASK_INTENSITY = "0.700000"
CRT_ANTI_RINGING = "1.000000"
InputGamma = "2.400000"
OutputGamma = "2.200000"
VSCANLINES = "0.000000"
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"
3 Likes

Looks great, what do you think about this compared to the cubic-gaussian filters?

1 Like

I need to play around with it some more but I think I prefer the gaussian vertical filter, the vertical filter can be a bit awkward at times as it’s currently configured.

1 Like

I just found a small bug. It causes some strange artifact at the left edge of the screen if the scale is odd (3x or 5x). Luckly I fixed it.

EDIT: Bug fixed! --> crt-hyllian-sinc (slang) - fixed

EDIT2: I like your settings with a small change: scanlines_strength at 0.38 and increasing beam_min_width to 0.68.

2 Likes

Increase beam_min_width to 0.68 if it’s too dark.

1 Like

You should add a curvature option to your shader @Hyllian.

Maybe, if there was some plug n’ play code available like the hunter’s mask one. It’s something that you shouldn’t reinvent the wheel, but just reuse some code. And, it should be a separated code running on an independent pass. I particularly never use curvature as I prefer my screen flat and without moire or other artifacts.

1 Like

I don’t notice this while playing at 4k but I did see these odd dark blocks around the pixels on Simon in some areas in Castlevania III. (You can see them better if you zoom in the picture. The pixels at the end of his headband and forehead for example.)

simon01

The functions here from rand to Warp are pretty easy to just plop into existing shaders, and you just wrap your texcoords in the Warp function: https://github.com/libretro/slang-shaders/blob/master/crt/shaders/glow/resolve.slang#L79

The rand/noise stuff isn’t strictly necessary and is easy to remove, but I think it’s a good alternative to the righteous moire that some scanline methods get when curvature is added, and I like a very small amount of it even without curvature (adds a little analog-y life/sparkle)

I see. Did you test the version with some bug I fixed some posts before? If yes, I’ll try to replicate here.

Thanks for pointing to it! I’ll look and see if it can be inserted as an option without slowing down the shader.

2 Likes

I did try with the latest and messed around with different masks but the issue was still there. Again, I’d never see it if I wasn’t zooming into a cropped screenshot.

Nevermind. It was there since the begining. It’s a small halo that the anti-ringing code didn’t catch. I don’t know how to fix this yet.

EDIT: fixed for the cubic-gaussian version. But then I figured there was a second halo bug only in the sinc version. Maybe it’s caused by the sinc negative lobe.

1 Like

That looks good too! A bit more like a consumer-grade CRT. Maybe a little too bright/washed out for my display. I prefer something between 0.50 and 0.68, 0.58 is looking very good IMO. Bright, but well-saturated. Also, I think it’s reasonable to increase mask strength to 80% with these settings in a dark room.

Is it possible to add a toggle for sinc and cubic-gaussian filters?

Also, for some reason I had mask 4 selected, but it should be mask 1 for displays with a standard RGB subpixel layout. The blue/yellow mask is intended for displays with a BGR subpixel layout.

The problem of unifying versions with different filters is that all param profiles lose meaning, because, for example, a scanline_strength 0.4 will have multiple visual results depending on the filters you choose. And I can’t predict exactly what a filter will do if I choose some param value. I just know the filter behavior if I increase or decrease some param.

1 Like

Fixed the two bugs!

What’s new:

  • Fixed a bug which was preventing anti-ringing to operate over some rare halos (thanks to BendBombBoom for point it);
  • Fixed another bug present only in sinc version which was creating some halos as a consequence of negative lobes from sinc filter;
  • Scanlines param for sinc version a bit modified so that it’s value will provide results very similar to the cubic-gaussian version.

crt-hyllian and crt-hyllian-sinc (bugs fixed)

5 Likes

I’ve tried, but RA doesn’t accept this line:

vec2 Distortion = vec2(params.warpX, params.warpY) * 15.;

And I don’t know why. I don’t have an slang debugger to know what’s wrong.

EDIT: Nevermind, I just found the culprit!

2 Likes