Trying Mask-less CRT Shaders

@guest.r

Would there be any significant gain in performance if you stripped the shader down to just the code for the scanlines, gaussian blur, gamma correction and bright boost?

2 Likes

That would most likely be the case, not sure how significant the difference would be. But on a lower end system it should make a noticeable difference.

Not that you really asked me, lol.

1 Like

There would be a nice performance gain for sure. Although scanlines are quite demanding part of the code.

https://mega.nz/#!olIGRAzL!_dnLPpbsCXVVM2NsCBerrAOxv6o6G1_43iLv269zfZg

I cleaned the code a bit… :slightly_smiling_face:

2 Likes

I thought I remembered you saying that about the scanlines lol. Didn’t want to comment on it though as I wasn’t really sure.

1 Like

@guest.r

Is that a single pass version of your shader?

If not what all passes are absolutely needed for this?

That’s an ā€˜ordinary’ shader. Single pass version could be possible though, but i’m not a fan of it since glow and bloom woudn’t work and the gamma in calculation would make it slower. Other passes are calculated at native resolutions, which are like 40x lighter.

1 Like

So linearize, linearize scanlines, both of the blur passes anything else?

1 Like

Really optional are the ā€˜color passes’ and the afterglow pass. Avg-lum pass is already referenced in the main shader, but can be easily replaced with stock shader. It really depends of your goal.

1 Like

The avglum pass is referenced in what you just uploaded but it doesn’t seem to actually connect into anything. (At least from what I could tell.)

Ehh I don’t really have any goals for this, I was just asking what @Nesguy was going to end up asking, lol.

2 Likes

That 2nd shot of Super Metroid looks very nice. I was wondering if you could share your settings of guest-dr-venom?

Thanks! I’m moving atm and my computer is packed up but I’ll post those settings when I get a chance.

2 Likes

Try this.

If desired, you can lower/raise the blur with h_sharp, and adjust the scanlines with scanline1 and scanline2. Or you can go wild with adjusting parameters :stuck_out_tongue: If you have a very bright display, I recommend mask type 0 and increasing the mask strength until brightness is reduced to a reasonable level, but make sure you have RGB subpixels first, otherwise it’ll result in color fringing / chromatic aberration. You may also want to adjust the CRT and/or LUT color profiles.

shaders = "11"
shader0 = "shaders_slang/crt/shaders/guest/lut/lut.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/shaders/guest/color-profiles.slang"
filter_linear1 = "false"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = ""
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/d65-d50.slang"
filter_linear2 = "false"
wrap_mode2 = "clamp_to_border"
mipmap_input2 = "false"
alias2 = "WhitePointPass"
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/afterglow.slang"
filter_linear3 = "false"
wrap_mode3 = "clamp_to_border"
mipmap_input3 = "false"
alias3 = "AfterglowPass"
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/avg-lum0.slang"
filter_linear4 = "false"
wrap_mode4 = "clamp_to_border"
mipmap_input4 = "false"
alias4 = ""
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/shaders/guest/avg-lum.slang"
filter_linear5 = "false"
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/linearize.slang"
filter_linear6 = "false"
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/blur_horiz.slang"
filter_linear7 = "false"
wrap_mode7 = "clamp_to_border"
mipmap_input7 = "false"
alias7 = ""
float_framebuffer7 = "false"
srgb_framebuffer7 = "false"
scale_type_x7 = "source"
scale_x7 = "1.000000"
scale_type_y7 = "source"
scale_y7 = "1.000000"
shader8 = "shaders_slang/crt/shaders/guest/blur_vert.slang"
filter_linear8 = "false"
wrap_mode8 = "clamp_to_border"
mipmap_input8 = "false"
alias8 = "GlowPass"
float_framebuffer8 = "false"
srgb_framebuffer8 = "false"
scale_type_x8 = "source"
scale_x8 = "1.000000"
scale_type_y8 = "source"
scale_y8 = "1.000000"
shader9 = "shaders_slang/crt/shaders/guest/linearize_scanlines.slang"
filter_linear9 = "true"
wrap_mode9 = "clamp_to_border"
mipmap_input9 = "false"
alias9 = ""
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/shaders/guest/crt-guest-dr-venom.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"
parameters = "TNTC;CP;CS;WP;wp_saturation;SW;AR;PR;AG;PG;AB;PB;sat;lsmooth;GAMMA_INPUT;TAPSH;GLOW_FALLOFF_H;TAPSV;GLOW_FALLOFF_V;TATE;IOS;OS;BLOOM;brightboost;brightboost1;gsl;scanline1;scanline2;beam_min;beam_max;beam_size;h_sharp;s_sharp;csize;bsize;warpX;warpY;glow;shadowMask;masksize;vertmask;slotmask;slotwidth;double_slot;slotms;mcut;maskDark;maskLight;CGWG;gamma_out;spike;inter;interm;bloom;scans"
TNTC = "0.000000"
CP = "2.000000"
CS = "0.000000"
WP = "0.000000"
wp_saturation = "1.000000"
SW = "1.000000"
AR = "0.020000"
PR = "0.150000"
AG = "0.020000"
PG = "0.150000"
AB = "0.020000"
PB = "0.150000"
sat = "0.100000"
lsmooth = "0.900000"
GAMMA_INPUT = "2.400000"
TAPSH = "4.000000"
GLOW_FALLOFF_H = "0.000000"
TAPSV = "4.000000"
GLOW_FALLOFF_V = "0.000000"
TATE = "0.000000"
IOS = "0.000000"
OS = "1.000000"
BLOOM = "0.000000"
brightboost = "1.000000"
brightboost1 = "1.000000"
gsl = "2.000000"
scanline1 = "10.000000"
scanline2 = "15.000000"
beam_min = "1.000001"
beam_max = "0.999999"
beam_size = "0.000000"
h_sharp = "3.000000"
s_sharp = "0.000000"
csize = "0.000000"
bsize = "600.000000"
warpX = "0.000000"
warpY = "0.000000"
glow = "0.000000"
shadowMask = "-1.000000"
masksize = "1.000000"
vertmask = "0.000000"
slotmask = "0.000000"
slotwidth = "2.000000"
double_slot = "1.000000"
slotms = "1.000000"
mcut = "0.000000"
maskDark = "0.500000"
maskLight = "1.500000"
CGWG = "0.000000"
gamma_out = "2.200000"
spike = "0.500000"
inter = "400.000000"
interm = "1.000000"
bloom = "0.000000"
scans = "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"
1 Like

@guest.r

Is there an option to reverse the mask pattern in guest-dr-venom? E.g., instead of magenta-green with CGWG, make it green-magenta?

I’m using an LED-LCD with BGR subpixels atm. It’s got a decent amount of brightness, so now I’m checking out masks again, lol. Good times.

1 Like

I know what you mean, like with the ā€˜guest-sm’ BRG setup.

You could modify the code a bit, to get the desired mask pattern.

Like now it should look like this:

cmask = cmask.rbg;
color = color*cmask;

instead of

color = color*cmask;

A newer version of the shader is to be used tho for this mod. Any version which calculates the ā€˜cmask’ value will do.

2 Likes

@Nesguy Also give the subpixel masks another shot with RBG, as I found a dumb mistake a couple of days ago that was making all of the yellow pixels blue(?). It didn’t matter much for RGB, but RBG uses yellow often.

2 Likes

@hunterk @guest.r

So I don’t know what I was thinking, magenta-green works fine for BGR subpixels, lol.

mask: MG

subpixels: BGR

result: BxRxGxBxRxGx… etc.

ahem, carry on…

1 Like

Thanks for the settings!

Just out of curiosity…are displays with RBG subpixel structure represented on the market? My google search gave me junk results on this topic.

BGR or RGB seem a natural choice, since luma value/coeficient of the green color is the greatest and it’s sort of logical for this subpixel to be placed in the middle.

2 Likes

I think RBG is just another name for BGR. It seems the naming of layouts doesn’t always reflect the actual location of the subpixel, oddly enough.

3 Likes

What @hunterk said. AFAIK, RBG and BGR are the same thing. BGR seems like the more accurate term since the screen would start with blue subpixels on the left.

1 Like