Please show off what crt shaders can do!

Here’s guest-dr-venom with horizontal sharpness at 3.00 and substractive sharpness at 1.00.

This is doing more or less what I want - keeping the black lines sharp while blurring the rest of the image. Is there any way to improve on this further (perhaps make it somewhat blurrier while keeping black lines sharp)? In image editing software we have the option of applying a gaussian blur and then applying a sharpen effect which uses a gaussian function to recover some sharpness. Is this something we can do in shaders? Or… is this more or less what substractive sharpness is already doing? My understanding is that it uses bicubic filtering; would some kind of gaussian function allow for greater flexibility? Sorry to keep bugging you about this. If it’s already optimized then I’m happy enough with current results :slight_smile: @guest.r

3 Likes

@Squalo

I’m also curious about that mask! Thought it was rotated lottes at first, but maybe a BW version? I don’t think it will look good at odd-numbered integer scales when using scanlines, but it looks nice at 4x!

1 Like

You could alter the sharpness coefs. a bit which are coded into the shader. Maybe this would be more to your liking:

float twl3 = max(wl3 - sharp1, 0.0);
float twl2 = max(wl2 - sharp1, mix(0.0,mix(-0.04, 0.00, fpx),float(s_sharp > 0.05)));
float twl1 = max(wl1 - sharp1, 0.0);
float twr1 = max(wr1 - sharp1, 0.0);	
float twr2 = max(wr2 - sharp1, mix(0.0,mix(-0.04, 0.00, fp1),float(s_sharp > 0.05)));
float twr3 = max(wr3 - sharp1, 0.0);
2 Likes

Combined with 120hz and my monitors overshoot at its fastest antiblur setting (close to 1ms), this is in my eyes the most convincing slot mask tv/arcade monitor simulation that I have ever seen from a shader, especially in motion. I can try to film a little video if someone is interested in the overshoot/low blur thing.

It looks even better fullscreen, believe you me. And regarding resolution, actually that’s a big part of the magic recipe. See, mask no. 3 is by far my favourite from easymode. At low res (720 or less), it and the scanlines appear harsh, huge, unnatural. At high res (1080 or more), it gets too coarse and the output image becomes more artificial. 960 seems to be the perfect golden balance. So don’t forget to set your games to that, and disable integer (heresy… I know, but I’m going to defy logic here and state that in this particular scenario, 224p games things look better stretched to 960 than 896 or 1120). And I can’t see any artifacts (unevennes, Moiré etc) whatsoever.

Also, I’m using good old easymode because I know that shader so well and it runs great in my old-ish system, but this look can most definitely be produced by the almighty guest and royal, maybe others too, as long as they use this mask or something similar. @guest.r himself published recently a lovely Ghouls’n Ghosts image that has similar ‘depth’, ‘pop’, ‘pixie dust’ or whatever it is. The preset I’m sharing has slight colour corrections, but bear in mind that those are system (even game) dependant. Just the basics. Some green to blue + bit of blue to green + bit of desaturation + bit of contrast = a good start.

I find it gorgeous :drooling_face:

shaders = "7"
shader0 = "shaders_glsl/misc/image-adjustment.glsl"
wrap_mode0 = "clamp_to_border"
mipmap_input0 = "false"
alias0 = ""
float_framebuffer0 = "false"
srgb_framebuffer0 = "false"
shader1 = "shaders_glsl/misc/color-mangler.glsl"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = ""
float_framebuffer1 = "false"
srgb_framebuffer1 = "false"
shader2 = "shaders_glsl/crt/shaders/crt-easymode-halation/linearize.glsl"
filter_linear2 = "false"
wrap_mode2 = "clamp_to_border"
mipmap_input2 = "false"
alias2 = ""
float_framebuffer2 = "false"
srgb_framebuffer2 = "true"
scale_type_x2 = "source"
scale_x2 = "1.000000"
scale_type_y2 = "source"
scale_y2 = "1.000000"
shader3 = "shaders_glsl/crt/shaders/crt-easymode-halation/blur_horiz.glsl"
filter_linear3 = "false"
wrap_mode3 = "clamp_to_border"
mipmap_input3 = "false"
alias3 = ""
float_framebuffer3 = "false"
srgb_framebuffer3 = "true"
scale_type_x3 = "source"
scale_x3 = "1.000000"
scale_type_y3 = "source"
scale_y3 = "1.000000"
shader4 = "shaders_glsl/crt/shaders/crt-easymode-halation/blur_vert.glsl"
filter_linear4 = "false"
wrap_mode4 = "clamp_to_border"
mipmap_input4 = "false"
alias4 = ""
float_framebuffer4 = "false"
srgb_framebuffer4 = "true"
scale_type_x4 = "source"
scale_x4 = "1.000000"
scale_type_y4 = "source"
scale_y4 = "1.000000"
shader5 = "shaders_glsl/crt/shaders/crt-easymode-halation/threshold.glsl"
filter_linear5 = "false"
wrap_mode5 = "clamp_to_border"
mipmap_input5 = "false"
alias5 = ""
float_framebuffer5 = "false"
srgb_framebuffer5 = "true"
scale_type_x5 = "source"
scale_x5 = "1.000000"
scale_type_y5 = "source"
scale_y5 = "1.000000"
shader6 = "shaders_glsl/crt/shaders/crt-easymode-halation/crt-easymode-halation.glsl"
filter_linear6 = "true"
wrap_mode6 = "clamp_to_border"
mipmap_input6 = "false"
alias6 = ""
float_framebuffer6 = "false"
srgb_framebuffer6 = "false"
parameters = "ia_target_gamma;ia_monitor_gamma;ia_overscan_percent_x;ia_overscan_percent_y;ia_saturation;ia_contrast;ia_luminance;ia_black_level;ia_bright_boost;ia_R;ia_G;ia_B;ia_ZOOM;ia_XPOS;ia_YPOS;ia_TOPMASK;ia_BOTMASK;ia_LMASK;ia_RMASK;ia_GRAIN_STR;ia_SHARPEN;ia_FLIP_HORZ;ia_FLIP_VERT;gamma_boost_r;gamma_boost_g;gamma_boost_b;sat;lum;cntrst;r;g;b;rg;rb;gr;gb;br;bg;blr;blg;blb;GAMMA_INPUT;GAMMA_OUTPUT;SHARPNESS_H;SHARPNESS_V;MASK_TYPE;MASK_STRENGTH_MIN;MASK_STRENGTH_MAX;MASK_SIZE;SCANLINE_STRENGTH_MIN;SCANLINE_STRENGTH_MAX;SCANLINE_BEAM_MIN;SCANLINE_BEAM_MAX;GEOM_CURVATURE;GEOM_WARP;GEOM_CORNER_SIZE;GEOM_CORNER_SMOOTH;INTERLACING_TOGGLE;HALATION;DIFFUSION;BRIGHTNESS"
ia_target_gamma = "2.300000"
ia_monitor_gamma = "2.200000"
ia_overscan_percent_x = "0.000000"
ia_overscan_percent_y = "0.000000"
ia_saturation = "0.900000"
ia_contrast = "1.050000"
ia_luminance = "1.000000"
ia_black_level = "0.000000"
ia_bright_boost = "0.000000"
ia_R = "1.000000"
ia_G = "1.000000"
ia_B = "1.000000"
ia_ZOOM = "1.000000"
ia_XPOS = "0.000000"
ia_YPOS = "0.000000"
ia_TOPMASK = "0.000000"
ia_BOTMASK = "0.000000"
ia_LMASK = "0.000000"
ia_RMASK = "0.000000"
ia_GRAIN_STR = "2.000000"
ia_SHARPEN = "0.000000"
ia_FLIP_HORZ = "0.000000"
ia_FLIP_VERT = "0.000000"
gamma_boost_r = "0.000000"
gamma_boost_g = "0.000000"
gamma_boost_b = "0.000000"
sat = "1.000000"
lum = "1.000000"
cntrst = "1.000000"
r = "1.000000"
g = "1.000000"
b = "1.000000"
rg = "0.000000"
rb = "0.000000"
gr = "0.000000"
gb = "0.090000"
br = "0.000000"
bg = "0.030000"
blr = "0.000000"
blg = "0.000000"
blb = "0.000000"
GAMMA_INPUT = "2.400000"
GAMMA_OUTPUT = "2.200000"
SHARPNESS_H = "0.000000"
SHARPNESS_V = "0.000000"
MASK_TYPE = "3.000000"
MASK_STRENGTH_MIN = "0.060000"
MASK_STRENGTH_MAX = "0.500000"
MASK_SIZE = "1.000000"
SCANLINE_STRENGTH_MIN = "0.200000"
SCANLINE_STRENGTH_MAX = "0.800000"
SCANLINE_BEAM_MIN = "1.000000"
SCANLINE_BEAM_MAX = "1.000000"
GEOM_CURVATURE = "0.010000"
GEOM_WARP = "0.030000"
GEOM_CORNER_SIZE = "0.030000"
GEOM_CORNER_SMOOTH = "100.000000"
INTERLACING_TOGGLE = "1.000000"
HALATION = "0.100000"
DIFFUSION = "0.000000"
BRIGHTNESS = "1.000000"
6 Likes

Thanks for sharing settings, but what mask type is that so I can try to put it into guest-dr-venom? I’m really only interested in the mask… :stuck_out_tongue:

If/when you get the time, can you please post a shot of a white screen w/mask strength at 100%? EDIT: NVM, figured it out! Thanks @Syh

Also, I’m pretty sure the anti-motion blur stuff introduces input lag :frowning:

At least, that was the case on my last monitor that had this feature. Maybe it’s not as bad/noticeable on your display. You can also probably compensate for this somewhat by using the runahead feature.

AFAIK, BFI is the only method for reducing motion blur that doesn’t introduce input lag (and might actually improve it?) but this comes with its own drawbacks, like significantly reduced brightness and weird artifacts on some displays.

1 Like

MASK_TYPE = “3.000000”

He posted it in the preset, it’s mask type 3.

You’re going to have to pull the entire mask code from easymode for it, unless @hunterk or @guest.r are kind enough to try and port it to the lottes/guest format for masks.

Well not all of it, as you could leave the other mask types out, but you need the majority of it, lol.

2 Likes

I’d like to discuss “depth” more, because that’s the primary reason why I prefer stronger scanlines at a reasonable viewing distance.

Stronger, more variable scanlines reduce the thickness of very dark lines and increase the thickness of very bright lines. This has the effect of increasing depth and adds “pop” / pixie dust to highlights. Thinner scanlines reduce this effect and make the image look flatter while also making the image softer and more blended.

For me, it’s absolutely a trade-off between “depth” and having a blended image.

Right now I’m using full strength scanlines (guest-dr-venom type 2) on a 46" display at a distance of about 7 ft. This translates to a 4:3 area that is 38", which is still enormous for a CRT; it’s on par with the largest CRTs ever made (Mitsubishi Megaview). 240p content just wasn’t designed for such large viewing angles. It’s also worth pointing out that average screen size in Japan is smaller than average screen size in the US.

The human brain comes equipped with an “autocomplete” feature that is activated by the black gaps between visible lines and which functions as a cognitive low pass filter. Moving closer to the display / increasing the viewing angle reduces the effectiveness of the cognitive low pass filter, so of course you need to add a lot more blur (horizontally and vertically, which also reduces the strength of the scanlines) in order to attenuate the high-frequency content that is now blasting your eyes. I also think the cognitive low pass filter doesn’t work the same with every person and so this is sort of subjective.

Anyway, that’s just sort of my understanding of how scanlines work and why/how they enhance the image.

@Syh

Yeah I was afraid of that, lol. Oh well; my current display probably couldn’t handle it very well, anyway.

2 Likes

Yes he did. He also explicitly mentioned that it is easymode’s no.3 :stuck_out_tongue:

@Nesguy - no, you are mixing up things. I’m talking about overdrive, which doesn’t affect input lag at all. Like, at all. What you get when you crank things up is inverse ghosting, which is generally terrible, but in this particular case, the effect looks kind of cool.

Run ahead is absolutely incredible when it comes to soft lag (emulator, game), i. e. those frames that you can count when frame by frame advancing. Retroarch’s extremely clever approach to vsync (and sync in general) takes care of the rest. But even all that can do nothing for display lag. In order to get rid of that you need a responsive screen. No way around it. And I am maniacal in that regard, so I just bought the fastest ips panel ever made.

“For input lag, the LG 27GL850 is the second fastest monitor we’ve tested. You’ll notice here we’re using a new version of our input lag graph which encompasses the three key components of latency: the processing time of the monitor, the average lag introduced by the refresh rate interval, and the average response time of the panel. At under 10ms of total lag in the chain, the 27GL850 is elite in its latency, and that’s thanks to sub-1ms processing lag. It’s only slightly beaten by the Aorus KD25F, which is helped significantly by its 240 Hz refresh rate.” (from the Techspot review).

This ‘depth’ I am talking about has more to do with the perceived resolution of the image. In the case of my preset, I believe it is provided by the dot pitch of easymode’s mask 3 @ 960p, which I find very pleasant. Sharp and soft at the same time. Notice how I removed any form of blur from my 240p chain. Not needed anymore (although I still use quite heavy 2nd pass AA for higher res cores like ppsspp, flycast, dolphin, and augmented res ps1/saturn). And of course, there is colour, which we have already discussed in the past.

The 100%, thick scanline look just gives me visual discomfort, certainly not an illusion of hires or depth. It also looks nothing like an actual 15kHz CRT, save for a few very high end models, which were never meant to display videogames, regardless of today’s CRT market trends. “Autocomplete” probably works differently from brain to brain haha. Mine tries to find the information trapped between those huge black opaque bars and fails.

1 Like

“Autocomplete” aka optical illusion mode, lol.

Your color setup is similar-ish to mine, upping the blue-in-green, and upping the green-in-blue. Though I also lift the blacks ever so slightly, and up the saturation via separate RGB channels.

1 Like

Let’s say a game has 3 frames of built in lag.

Your TV has 3 frames of input lag.

If you remove the 3 frames of built in lag with runahead- now you have the original input response time. At least, that’s how I understand it…

I think you’re very, very wrong about this. Guest-dr-venom with 100% scanlines looks more like the scanlines on a consumer-grade Trinitron than anything else. Perhaps you’re more accustomed to / prefer slotmask displays, but you shouldn’t go spreading misinformation like this.

Look at an extreme close up of any consumer-grade Trinitron (in-focus, high-quality macro shot) and pay special attention to the thinnest possible lines and the thickest possible lines. The ONLY way to match that level of beam width variation with a shader @ 1080p is to have 100% scanline strength, period. Honestly, this doesn’t even completely match the variability of the consumer-grade Trinitron and uses a visual trick that is dependent on viewing distance (reducing the brightness of the top/bottom of the visible lines).

What you call “optical illusions” are really just features of the human cognitive-visual system and these features are absolutely essential to how all display technologies work… you couldn’t have motion without “optical illusions”

I don’t use easymode and wasn’t aware this was unique to easymode, thought maybe you could just say “It’s Lottes blah blah with blah blah” or something. Sorry for being lazy.

2 Likes

I think you took that in a different manner then intended, I reworded autocomplete to optical illusions for others to better understand, I wasn’t complaining or anything.

Also optical illusions have been around for centuries, they’re something that we started doing and that just exist naturally, by exploiting that exact cognitive function (at least I’m pretty sure, I don’t feel like using Google, lol), so yeah optical illusions. The human brain loves finding patterns in everything even, when none exist.

Your good, I’m not mad about it or anything.

1 Like

Ah, sorry. I’m just being an old depressed asshole and I should probably just go to bed.

3 Likes

@Syh - yes, I feel you. The cooler greens and not-so-deep blues look way more natural and closer to tube screens. Since those yellow tints are particularly obvious in japanese games from the 80s and 90s, I theorised that it has a lot to do with the fact that the white reference of NTSC-J is 9300K (quite cold). Japanese developers graded their games accordingly, and we are playing them today in 6500K (quite warm… in fact too warm in my opinion but that’s a story for another time maybe) ecosystems. The two add up, which results in unbearably yellow retrogaming. On top of color mangler corrections, I calibrate my screens to 7900K, the mean between japan’s coolness and the western world’s warmth. Interestingly, Apple seems to be pushing a similar temperature in their calibrations. That’s one of the reasons why their laptops and iMacs look so nice out the box. D65, industrial standard as it is, is just too warm.

@Nesguy - we have argued about the 100% scanline thing many times already, no need to go back there. We have divergent tastes that’s all. You need to find a mask that you like, that should be your priority at the moment haha :slight_smile:

That’s absolutely correct, as far as I know. An ideal scenario, too. But what if you are maniacal and those 3 frames bother you, even if you know that they were there in the original game (my case)? And what if the game has less lag than your TV? If you overcompensate for that, you get inputs that will still feel laggy and also grossly skipped frames, since the emulator will loadstate the future at every button press. I believe that 2-4 frames of lag @ 60fps and 4-8 @ 30fps is how most games operate out of the box, anyway, and most people don’t care about those little delays. But some of us do. That technology is one of the best selling points of retroarch. Hard to go back once you get used to it.

Haha well, most of us around here are old grouchy arses, aren’t we! And hey if the depression part is for real, I really hope you can get out of it man. Play Kirby games when you need a cheer up :slight_smile:

3 Likes

My TV has a computer color temperature mode which seems to be in between cool and warm temperature modes, lol. So sorta the same.

2 Likes

Oh I like plenty of masks, I just can’t get any to work right on the current display I’m using lol. This current display has bad green push coupled with undersaturated reds and blues and there’s no fixing it without making the image too dim. On top of that, there’s a very annoying auto-dimming feature that is made worse by masks. The only reason I’m using this POS is because it was free and the rest of my stuff is in storage.

Actually, quite a few masks can improve the objective picture quality in addition to providing texture and making the image more interesting. The cgwg masks, the rotated Lottes mask and some BW masks are good, but they all come with certain caveats and some displays can have weird artifacts with certain patterns. There are also some masks which are just bad IMO because they cause clipping and/or chromatic aberration.

I didn’t mean to beat a dead horse but I think it’s literally impossible to get the beam width as thin as it gets on a consumer Trinitron without maxing the scanlines @ 1080p; with higher resolutions you don’t need max scanlines and it’s probably not desirable. When I examined the thinnest lines on a consumer Trinitron they’re like 1/5th the size of the black gap. Since there’s no black space between phosphors with an aperture grille, the only thing limiting vertical detail is the width of the electron beam and beam focus. 1080p doesn’t even really cut it for the beam dynamics. I get that tastes differ though and not everyone is into the super dramatic beam dynamics on aperture grille CRTs.

I’d like to see a video of your display in motion, definitely. I’m curious to see if there’s a reduction of curvature-related moire. I’d like to add a slight curvature effect but the moire always kills it for me.

That’s an interesting tidbit regarding Apple displays and color temp. I’ve also been using a middle color temperature for a while now just because I like the way it looks :stuck_out_tongue: I still prefer 6500K when watching a movie in a dark room, though.

1 Like

Here’s a comparison illustrating what I was talking about regarding scanlines in my previous post. First shot is a cosumer-grade 27" Trinitron. Second shot is guest-dr-venom with scanline type 2 with beam shape parameters maxed out and beam-min and beam-max both at 1.00.

Notice how the thin lines circled in the second shot are even thinner in the first shot, proving that even when the scanlines are maxed out in shaders, the beam dynamics @ 1080p still aren’t a match for an average aperture grille CRT. At 1080p you’re still relying on visual tricks to emulate beam dynamics (darkening the top/bottom of each line by a certain amount instead of actually reducing the width in pixels).

So if anything, the scanlines need to be even stronger just to match the dynamics seen on a regular old consumer-grade 15kHz aperture grille CRT.

Here’s another CRT shot just for fun and to illustrate just how sharp these things actually were. It’s probably even sharper IRL because the camera is adding some blur.

1 Like

You really enjoy arguing with me haha. Yes, I know how Trinitrons look, they are fantastic and produce strong scanlines indeed. Leaving aside the absence of the grill and any bloom whatsoever, and also the warm tones, it is true that the dark part of the image (the scanlines themselves) is very very similar between the shader and the real thing. I give you that. I also like how you solved the sharpness issue, like I told you some time ago. Problem is the bright part of the image (i. e. the game itself). CRT emulation is not just about faithful scanlines, there are many more factors involved. That is why I say that it looks nothing like a tube tv. It is way too muted, look at your own screens! I can barely even see anything in the shader shot. Blacks crushed, whites anemic, gamma all over the place.

As much as I appreciate your proficiency, and the fact that you are helping push shaders to new limits, man I swear I don’t really understand your approach. On one hand you complain about masks darkening the image a bit but on the other you seem hell bent on applying those ill-lit settings of yours that absolutely kill brightness. And yes, I know you can make up for the lost signal by cranking up a capable monitor to 800 nits or whatever, but that’s really not a good solution unless you have a dedicated tv for retro. It will destroy any calibrations and it’s also quite inconvenient, needing to adjust every time you feel like playing an old game. But then again, if you like it like that, all the power to you, you really don’t need to convince me of anything. Now make a preset that looks good in a normal, calibrated environment, and sure, I might get on board. I have told you all this so many times already…

Cool, I will see what I can do.

Regarding Apple, when you calibrate their screens to D65 (which is something that I need to do anyway for work, even if I don’t agree with that standard), they become way warmer and more washed out. Their computers consistently come with iccs that produce high contrast, low gamma (a bit too low for films, in fact) and cooler temps (a bit too cool for films perhaps, although I like it, looks more like real life and whites appear actually white). It has been like that for a long time already (at least 15 years).

D65 is a century old standard that needs a serious update. I believe it is obsolete and I like that a giant such as Apple is pushing something more modern and accurate that takes into account the switch to digital/RGB. Good to know some people around here seem to agree, too :slight_smile:

1 Like

We shouldn’t assume that the CRT in this shot is properly calibrated, and I merely posted these to illustrate the differences in beam width dynamics. I know there are large differences in color, brightness, etc. but for the purpose of this comparison it shouldn’t matter too much. I make no claims to the accuracy of the colors in the shot I posted. What you’re seeing in that shot is a work in progress as far as color and such is concerned.

The image I posted is definitely too dark with a normal backlight setting, but that’s not something that can be fixed without a wider color gamut or introducing clipping, and I prefer to avoid the clipping because I find it more distracting than the lack of brightness, which is easily compensated for by cranking up the backlight.

Color managing these things is a difficult task without a wide gamut display; you’re always going to have either crushed blacks or clipping or poor shade separation. I’ve been playing around with Dogway’s grade shader and still can’t produce the results I want. That’s why the gamma is weird.

Sure, I could jack up bright boost to make the image brighter… but then I’m raising the black level much higher than the SMPTE standard. Actually, the black level in the shot I posted is already a bit higher than the standard for NTSC. The test patterns don’t lie…

A lot of TVs save different calibrations for each input, including all the ones I’ve recently used, and I have a dedicated emulation PC hooked up to one input so it’s not a big deal for me to max out the backlight on that input.

Since you seem willing to sacrifice black level for greater brightness (which has a really bad effect on the contrast ratio), I think I could come up with something that you’d find acceptable. I just personally really dislike how flat these images look with a reduced contrast ratio. On a CRT the highlights jump off the screen. Raising the black level also tends to have a bad effect on saturation, making everything look washed out. I’ll see what I can do though.

Edit: See two posts down; I think these are adequately bright with a normal calibration and still have good saturation and dynamics. What do you think?

2 Likes

This is as dynamic as the scanlines are going to get at 1080p with my display. I followed the method I posted here.

I think this is adequately bright on a properly calibrated display, but cranking up the backlight doesn’t hurt, either. :wink:

Just using regular sRGB gamma because everything else looks weird on this display.

“Now in 9300K!”

3 Likes

Yeah, I’m preferring the sRGB mode, the new mode @Dogway added is nice but my display isn’t calibrated for it. (Super unsaturated looking for me currently, the new mode.)

The colors look nice in that Castlevania screen.

1 Like