New CRT shader from Guest + CRT Guest Advanced updates

Excluding masks 7 and 8, they are actually aperture masks and produce a different TVL look with different resolutions. Ofc. modern LCD, OLED… technologies have their own quirks (subpixel spacing…) so they come in different flavours.

Sony trinitron TV’s had RGB aperture masks and different TVL and mentioned masks are aperture type, so maybe this answers your questions.

You can also use then for slotmask setups and some of them for shadow masks (with shifting).

‘Creator intentions’ are regarding aperture emulation different TVL ratings and different subpixel spacing setups.

Masks 7 and 8 (BW) are something to be used if they look better compared with some “RGB” masks, like with some displays with strange subpixel layouts, rotated games etc.

5 Likes

Talking about masks, i have managed to nicely, without a performance hit, implement automatic controls for the slotmask width.

I find it great, that less GDV proficient users may use the slotmask feature without staring in the screen or guessing some variables.

Of course current presets shouldn’t be affected…

12 Likes

This is really great! Thanks @guest.r!

5 Likes

New Release Version (2023-05-07-r1):

Notable changes:

  • slotmask auto width implemented, default is now “auto”
  • slotmask height default is now 2.0
  • support for 16-size 3D luts implemented

Download link:

https://mega.nz/file/o1Qm0TSK#XpS0Rq7gDKcNobLlXt-TObnKFNV1eLnTjoE7nNFHRHo

13 Likes

Wow.
Thank you for going out of your way to support 16 LUT.

5 Likes

I gave this update a quick spin before I stepped out earlier. Indeed the new Slot Mask settings doesn’t effect my current presets at all. So let me get this straight, this “Auto” Slot Mask width setting will automatically choose the correct width variables to use no matter the resolution?

2 Likes

It will adapt to the mask width and mask size. You can change masks on the fly and slotmask will be aligned.

But if you want something ‘exotic’ you can still use manual slotmask width setting.

4 Likes

Wow that’s interesting. I’ll have to give this further testing when I get home later but it looks like I could be able to switch that setting to auto and my presets will all still look the same regardless of the resolution.

4 Likes

@guest.r This feature is amazing! I’m able to get much less chroma bleeding on Mega Drive/Genesis games while still having transparencies intact.

Chroma scaling = 1.0

Chroma scaling = 1.8

If you alternate between the pictures, the difference is clearly visible in the trees, the yellow letters in the hud and the background mountains. This makes a world of a difference for 2 phase games! Thank you so much for this feature :slight_smile:

And here’s the waterfall completely intact even at the maximum value of Chroma scaling = 2.25

Of course, I always go looking for the drawbacks of these “magical” features to see if there are any compromises and I was surprised to not find almost anything bad. Is there a catch?
It seems to me this could not be the way real CRTs managed to reduce chroma bleeding, because this seems an impossible mechanism to real NTSC systems, am I wrong?

The only thing I found was this strange zigzag pattern when increasing chroma scaling:

Chroma scaling = 1.0

Chroma scaling = 2.25

It’s only visible on the colored bars, and you’ll need to open them fullscreen to be able to see the zigzag. Is this a bug, or intended?

@hunterk It would be nice to have these new features available for everyone on the libretro repo :wink:
I believe the last update was on February.

4 Likes

@guest.r

How does the chroma scaling work?

Is it something like blurring the chroma leaving luma intact or like the signal bandwidth section of GTU shader maybe?

4 Likes

Thanks! Means a lot to me also in new features do well and are tested and used. :smiley:

It’s a ‘feature’ of the chroma scaling. Since chroma weights are perfectly calculated there can be quirks and limitations of the functionality based on them if “defaults” are changed. That’s why chroma scaling is limited to like 2.25, because more it’s too much for current implementation.

Maybe a better implementation is possible, but it’s not trivial since it can spoil luma-chroma cross-talk and features based on it. But i guess it works well enough.

With ntsc-adaptive chroma and luma are processed separately and summed up in the second pass as a horizontal filter. With ntsc resolution scaling both are up or down scaled evenly, but with chroma scaling, which is more or less a ‘hack’, chroma blur/sum radius gets smaller or larger and can mitigate color bleeding.

5 Likes

Thanks to this ‘hack’, CRT-Guest-Advanced-NTSC just got much more useful!

I really appreciate this. Going to update all of my Genesis NTSC presets where the bleeding was an issue at some point. This also brings some new and interesting possibilities for my non-Genesis presets, where I used the NTSC Resolution Scaling to regulate the colour bleeding. The latter probably won’t be a priority though as it seems to fit well with either 3 phase or Merge fields enabled. It was only with 2 phase in combination with Merge fields disabled that things were a bit out of control.

Lastly, there was this strange artifact that I was seeing when scrolling up or down in front of the waterfalls in Sonic The Hedgehog. It’s not visible when the emulator is paused. At some point I’ll try to capture it and see if I can better explain what I’m talking about. Have you noticed anything strange when you’re looking up or down when in front of the waterfalls @nfp0? Like sort of combing effect?

3 Likes

No problem! Awesome features like this are a godsend.
Now I don’t think we need to rely on the Blargg filters anymore.

It seems the artifact I mentioned is also present on the base NTSC-Adaptive shader in S-Video mode (my screenshots were also in S-Video mode), so it seems it’s normal, after all, and not an issue with your new NTSC chroma scaling feature.

Base NTSC-Adaptive shader in S-Video mode:

Maybe the zigzag is not visible at chroma scaling = 1.0 on my other post because it’s hidden with the filtering or mask.

I also saw the ntsc_cscale is only used in ntsc-pass2.slang but not in pass 1, so am I right in believing this trick is not possible on real CRTs?
I was hopeful this trick could explain how real CRTs have less color bleed than the NTSC shader at default settings.

I notice artifacts in front on the waterfalls if I have the NTSC Preset setting set to Composite or RF, but it’s perfectly smooth in S-Video mode.
It’s strange that I notice the artifacts when moving left/right, but not up/down like you.

2 Likes

A bit quick to right off Blargg aren’t we? There are still a couple things that I’ve noticed that don’t happen when using Blargg. If anything it’s good to have more options but I think I see your point.

The term “artifacts” by itself can be a bit vague. There are different types of rainbow and dot crawl artifacts that are visible when odd and even fields are not averaged as well as when using 2 Phase instead of 3 phase along with a lower NTSC Resolution Scale. Most of these “artifacts” make up some of the main reasons for using an NTSC Shader. I’m talking about recreating behaviour as well as producing crucial effects that were present in real hardware, especially Sega hardware.

What I was referring to specifically was a type of combing/interlacing artifact (without the sawtooth edges) that appears when looking up or down in real-time when in front of the waterfalls in Sonic The Hedgehog. This doesn’t seem to occur when using the Blargg SNES filter and I don’t think it occurs when using the Genesis one either. I’ll try to make a video and also see if I can get some screenshots of it soon.

Tap on image then zoom in for best viewing. Desktop users, right click then Open in New Tab, then press F11 for FullScreen. Non 4K users, zoom in until it looks correct.

Click here to download video

3 Likes

Haha, yeah I guess I was quick to dismiss Blargg’s filters. In fact, I don’t know Blargg’s filters that well. There might be NTSC particularities that are better emulated there.
But this NTSC chroma scale feature from Guest solves a big problem I had with NTSC.

You’re right. More specifically, the artifact I see when moving left/right is also visible in a still frame. It only becomes smooth when the game is running normally but the camera is stopped. Here’s what it looks like:

It’s more noticeable in the upper part.

But no, when moving the camera up/down, I can see no obvious artifacts. It seems smooth, the same as when it’s stopped.

3 Likes

I really like this mask 11 for GBA games! But there is something that i do not understand tho, as you can see in the picture the mask seems gone around the dialogue box when i go to the menu and when i press B to go back to the game the mask appears for a brief second, is this a normal behavior? Or is it a glitch? I’ve noticed this happens mostly in white white/bright backgrounds.

1 Like

Hey @ledoeye!

The issue you are showing is most probably related with increased game related brightness ‘flashes’ when entering the menu etc. You can be more sure if you test it with another game.

Brightness can influence mask strength in guest-advanced, this is one of the basic ideas of image representation, but if it’s too much you can also increase mask strength, lower bloom etc…

Otherwise it shouldn’t be a shader related glitch, but thanks for mentioning it anyway.

3 Likes

That’s certainly caused by the fact that the text box is very bright, which means the bloom is hiding the mask (a necessity to compensate for the lack of brightness caused by the mask).
The reason why you see a stronger mask during the transition when you press B is because the game fades the image to a darker color, which reduces the bloom and makes the mask more visible.

One trick many users use to avoid this is set the TV/monitor’s brightness to the highest possible value, and then reduce the amount of bloom.
But of course, this can be cumbersome if you use the TV/monitor for more than retro games.

Another solution is using HDR with the Sony Megatron HDR shader, which I believe is the only CRT shader capable of HDR. But that’s a different shader and comes with it’s own set of restrictions.

3 Likes

Sorry @Cyber. There are no notifications for edited posts, so I didn’t know you added screenshots and a video. It’s better if you make a new post so that we get notified.

But thank you for the video! It was much easier to understand what you meant now.

On your video (at the realtime part), I can see the artifacts when you move left/right, but not when you look up/down. But you mentioned that you can see combing artifacts when looking up/down? Or did I get that wrong?

Using Guest’s shader I seem to get the exact same artifacts as your video. They’re visible when moving left/right, but not visible when looking up/down. And also always visible in slow-motion, ofc.

1 Like

Yup it was indeed the Post Brightness / Bloom. I increased it a bit because i’m gaming on a Sony Trinitron CRT and these monitors while being amazing they get dim with CRT shaders which is a shame cause the colors on these things are out of this world. Thanks @guest.r

4 Likes