New CRT shader from Guest + CRT Guest Advanced updates

Just to clarify, I’m not trying to knock anyone’s efforts- In fact, given the severe limitations of LCDs, I think the results you can obtain with shaders are quite impressive. I just don’t happen to like the compromises that have to be made when attempting phosphor emulation on your average LCD.

You’re right that the mask isn’t supposed to be visible, but it has an effect on the appearance of scanlines even at normal viewing distances. Also, if the mask is at maximum strength, pure white should still appear as pure white at normal viewing distances, the same way it works on a CRT. A CRT doesn’t display pure white, it displays 100% red, blue and green and they combine to form pure white at normal viewing distance. If you get close enough to a CRT it’s nothing but red, blue and green dots at varying intensities.

IMO, we already have it! Just using the scanline-mask shader, you can achieve results that are as close to perfect as you can probably get if you max out the mask and scanlines, disable the bright boost, max out the display backlight and adjust the gamma accordingly. There just aren’t many displays that are bright enough for this to work. CRT emulation will be a lot simpler and require a lot fewer “tricks” in the future, when much brighter displays are more common.

Yeah, that’s definitely an important consideration! You could wind up spending just as much on the PC as you do on the display itself.

You only really “need” 8K if you’re wanting to do slotmask emulation (which seems to be what everyone wants as it was the most common type used in CRT TVs and arcade monitors). Otherwise, even 1080p is adequate for aperture grille or dotmask emulation.

Can you elaborate on this a bit? I think I sort of understand what you’re saying but it’s not 100% clear to me.

1 Like

That looks wonderful, @guest.r. I think your shader is the most complete and overall best (certainly at least in terms of quality/performance balance) right now. Hell of a good job! Can we please get this latest version in glsl?

3 Likes

Can you elaborate on this a bit? I think I sort of understand what you’re saying but it’s not 100% clear to me.

It’s related to human sight specifics, where small but stronger light emmitors can appear bigger compared with non emmiting conuterparts in relation from viewing distance.

That’s why for example base colors on a LCD display appear uniform from a normal distance. Intensity can compensate size. That’s why i think that a crt shader can look very authentic even with a maxed rgb mask if the settings are right.

But…but…i’m also very interested in how the image looks from afar on an average lcd. It makes life far more interesting, because the opposite of what i wrote above can also be true. Human eyes simply average small and close together light sources, which is nice, because we can use this to do some concepts. :slight_smile:

That’s why it comes down to aesthetics (like uneven scanlines are just bad), color reproduction and resolution also. I try to make the best of it and regarding this for now.

As @ProfessorBraun mentioned, the time for shaders for high-tier displays will come eventually.

2 Likes

Thanks for liking the shader! :hearts: GLSL would be a hell of a challenge because of the power of two textures it uses. Can you use the glcore driver? My old adapter accepts it services without issues. :grinning:

1 Like

I already know all of that, my english must be very bad ! (I learned the basics 30 years ago at school for my defense ). I was talking about how people act with their LCDs ( shader applied) and the distance they are playing. I should have said if mask size is 1.0 in shader,there is a chance that you won’t see it depending the distance you are playing from screen,so pure white on srgb lcd explanation-> Values are (tint: 160 saturation: 0 bright: 240 R: 255 G: 255 B: 255). If you apply maximum mask strenght or even less then max on an lcd that is not bright enough (nits) without bloom effects and other tricks. You will obtain lower values maybe i don’t know something like this (random example) tint: 160 sat: 0 bright: 212 R: 216 B: 216 G:216. So pure white is not anymore pure white and some people don’t want to play without pure white for the moment. Some screenshots that I saw here were displaying on some areas grey instead of white like it should with values mentionned above. That’s why I think bloom is a good think for compensate. I hope that is clearer :man_teacher:. It’s really unlucky that a guy from amiga english board is not registered here, he would explain interesting things about CRTs never seen here.

2 Likes

I get what you’re saying, now. :smiley:

Your english is fine, sorry if I’m telling you stuff you know already :smiley:

You should invite him over here! Always good to have knowledgeable people around.

IMO we already have everything we need for accurate CRT emulation when it comes to shaders; your scanline-mask shader could do it if you have a good enough display. No further advances are necessary when it comes to shaders; we’re really just waiting on better displays, now. :slight_smile:

1 Like

I finally snapped and unplugged my lousy TN panel LCD (ASUS VG248qe) and listed it on Craigslist. My emulation PC is now hooked up to my living room TV, a 60" plasma, and I should have done this a lot sooner, lol. The black level, contrast ratio and picture uniformity on the plasma is just so much better, and it only has 30ms of input lag. The ASUS had less than one frame of input lag but the picture quality is just so terrible that it isn’t worth it anymore IMO. Plus, playing games while sitting on the sofa is just a much better experience than sitting at a desk in front of a monitor. The plasma is only inferior when it comes to brightness, but this is only really a problem when trying to play a dark game in a room with a lot of ambient light. The way the plasma regulates brightness is different compared to an LCD, so no adjustment to the TV’s brightness is needed. Adjusting contrast to 100% helps, though.

On the plasma, no gamma correction is needed. The only changes I’ve made to the default settings:

-remove the mask altogether (mask light and dark both at 0.00)
-horizontal sharpness at 4.00
-scanline center at 10.00
-scanline edges at 8.00

Now I’m wondering if upgrading displays is really worth it!

Researching the Samsung QLEDs further, I found that many of them have a special coating to help with off-angle viewing, but this actually makes all the subpixels look washed out, so the phosphor emulation wouldn’t be great on such a display. There are Samsung QLEDs that lack the special coating, but these look bad at an angle; not great for couch co-op sessions. So many trade-offs! It really is better to just snag a decent CRT display if you can find one.

The Samsung QLEDs are still great for those trying to do black frame insertion + scanlines, and most of them have less than 1 frame of input lag at 1080p at 120Hz, but you should do your research first if you care about phosphor emulation! If phosphor emulation is high on your list of priorities then you need to get one of the QLEDs that lacks the special coating.

Hehe thats really nice to hear. :slight_smile: I would love to play around a bit with a high profile hdr display and extended color values range. My current implementation clamps the result to sdr 0-1 range. Dunno what to expect, web screenies are useless lol.

Otherwise gl with your display purchase. I’m really on the edge here since i’m pulled into the 1440p domain. I think it should be a super choice, perhaps not for vertical games (ok i can rotate the display, i forgot :upside_down_face: ), but one can’t have it all.

Nevertheless, i managed to fix some remainin issues which i wasn’t sure if there are simple and fast solution for them or i got some new ideas.

  • bloom saturation is fixed now
  • bloom mask is calculated seperately
  • better quality ‘dispersed’ bloom
  • better quality ‘hard bloom’

https://mega.nz/#!VsQQhSYC!KBcVsSTKv5lmgOL9O3f7IcpOEwr1PiyHeGiSKjtlEjM

5 Likes

I’d like to try the bloom effect; does this only work with SLANG?

1 Like

The new features are slang only atm., yes, since i’m working on this version. Slang has 0-1 buffer range for source image which allows some buffer tricks which are hard to do in GLSL. You mentioned you have trouble with glcore? Maybe D3D11 would work. It has issues with scanline smoothing, but otherwise it’s much faster on my odapter.

Got a chance to play around with the new version.

Running shaders on a plasma TV makes it really clear that a lot of what shaders are doing is there to compensate for the shortcomings of LCDs. To get the best results on my plasma, I had to disable a lot of features, including the bright boost. I had to completely remove the mask because the plasma doesn’t have subpixels that work like those on an LCD. Now I’m just looking for a lightweight shader that will do variable scanlines, some adjustable horizontal blur/interpolation, and options for automatic brightness and gamma correction.

The automatic brightness correction is a very nice feature!

I’ve been meaning to ask for a while- is there some other kind of interpolation / blur / etc that can be used? I really prefer the way guest-dr-venom handles horizontal sharpness/blur.

I recently tried all of the CRT shaders again, and the only ones that even come close to doing what I want are:

CRT-aperture
CRT-easymode
CRT-geom
CRT-guest-dr-venom
CRT-guest-sm
CRT-hyllian

So far, I’m getting the best results with CRT-guest-dr-venom or CRT-guest-sm. I really like the automatic brightness correction in guest-sm, but I kind of prefer the way CRT-guest-dr-venom handles sharpness/blur. EDIT: actually, I see pros and cons to both. I seem to be getting some unwanted edge artifacts with guest-sm, but the scanline edges themselves look better, if that makes any sense…

MAME HLSL and CRT-Royale could probably do what I want, but they’re both too complicated for me :stuck_out_tongue:

You can increase the speed of the shader by a large ammount if setting the commented #scale_y factor to 1.0. It should do fine on 1080p i guess. The preset can be edited i mean. :slight_smile:

It’s a bit shy for the time being, but i have plans for a more useful implementation. Thanks for giving it a try. :wink: I decided to go to the root of the problem - heavy scanline brightness reduction. I have also found a way to preserve masks and scanlines from clipping by using a larger ‘bright pixel brightboost’ parameter. Scanline clipping is very annoying at non-integer scaling factors as some same color lines can be very thin and the next one much more outlined. Should be introduced soon.

Yeah, it makes sense. ‘Dr. Venom’ version uses a 5 pixel filter with clamping to 3 pixels, while the ‘sm’ version filters 4 pixels and clamps them to 4 same pixels again. This allows more colors, but some stray colors might sneak in. it’s not very annoying though. Second, later shader uses different masks which can affect how pixel edges look, as the brightness is different compared to the center. I’m happy with both versions the ‘sm’ is easier to handle imo. :slight_smile:

1 Like

I probably asked about this already, but would it be possible to add an additional option to smart integer Y scaling that scales the image to the smallest value that results in no letterboxing (black space at the top/bottom)?

Currently, smart integer Y scaling scales the image to the largest integer value where all of the image is still visible, but this often leaves black space at the top/bottom of the screen. If you scale to the next highest integer value it would crop the image, but the amount that gets cropped is within spec for CRT TVs.

1 Like

I could add manual overscan to the shader, wouldn’t be the first request for it. Smart integer scaling tries to avoid too much overscan or too much cropping, so it selects the most appropriate option. It’s a nice functionality because the scanlines are even. Smart overscan isn’t doable or too expensive to calculate, so it isn’t an option.

As i mentioned before, shader doesn’t know if that’s a per game situation, so each frame must be processed to maybe find a good stretch. It requires user involvement. :upside_down_face:

1 Like

That makes sense, thanks!

For smart overscan, it seems like an RA user option would be the best option. We already have CRT switch res, which detects the resolution of the game and switches resolutions on the fly. Seems like it wouldn’t take that much additional work to detect the output resolution and then scale the image to the smallest size that eliminates letterboxing.

-Detect output resolution

-multiply the Y axis by the smallest integer that results in more than 1080 pixels

Seems like it would take just a few lines of code but I’m probably underestimating the difficulty.

On a different note:

Lately, I’ve been playing some PSX games and it’s giving me the urge to blur the hell out of everything.

I’m noticing some somewhat harsh transitions on lower sharpness settings, any way to smooth those out? It’s really noticeable with the white text on the grey background. For the most part the edges look great, but occasionally there are some harsh transitions.

Note that I’ve completely removed the mask since masks don’t look right on a plasma TV because of how they work. Does this shader require the mask in order to get the best results? Any suggestions for running the shader without the mask?

1 Like

It didn’t take much work indeed once i managed to do over/under scan. :rofl:

No, thats quite easy and fast. The problem, as always, lies in the limited vertical resolution of the 1080p displays. 1440p is much nicer, although 1440 / 224 = 6.43, which means underscan is more an option at this resolution. That’s why i added scanline smoothing, so you can play at full y display capacity with much nicer scanlines.

Is adapted in the upcoming version, since you can add sharpnes with ‘cubic’ filtering. It can still look a bit harsh since only 4 texels are used for blur. 5 or 6 would be better, but the speed would be reduced and they don’t contribute much with a sharper setup

That’s a tough one, i don’t like it without masks either. Other shaders would be better used for this, Dr. Venom version for example (has smart integer scaling also). It has better blur and other options.

2 Likes

Just wan’t to throw in an “Autobright” demo image. I just picked up some “impossible” settings and it looks like this by ‘AI’ brightness adaption. :grin:

I started from default setup. :slight_smile:

Edit: Here’s another example…

PSP games or TATEd games look also very nice due to ‘improved’ brightness.

5 Likes

@guest.r Is the new bloom mode for dr-venom still a possibility?

Nice screenshot!

1 Like

I’m careful about adding something to crt-guest-dr-venom, but it’s compatible with the new bloom. I’ll take my time and rethink some nice changes, without spoiling anything.

I forgot the link to the new crt-guest-sm version…:wink:

I know brightness was an issue with scanline type 0 and 2 … not anymore. Now you can try different settings without worrying much about it. Works very well…ofc. it can be turnd off lol.

https://mega.nz/#!ZtpwQSCZ!vZ3F1BwlrtoxVEHXuDasIrGPG6Ew0Qn_pnn3lmWbh1o

3 Likes

I was trying to port it myself but was having issues myself…

I’ll check out the new version of this.

1 Like