New CRT shader from Guest + CRT Guest Advanced updates

I never owned an Amiga and didn’t discover it until I began by emulation rabbit-hole. I’m so glad I people have kept it alive as it has such a unique library and comparing ports between PC, Mac, Console and Amiga is very interesting.

@Rincewind Really nice article. Is there reason you use WinUAE over the PUAE core in retroarch? I’m no amiga expert but it loads everything I throw at it with little issue.

2 Likes

@guest.r Something I’ve been wondering for a while: why are some masks hooked up to certain mask strength controls while others aren’t? I notice, for instance, Masks 0, 11 and 12 are excluded from the Mask Low Strength parameter, and the Lottes Masks have their own mask strength parameters. Moreover, these mask strength parameters don’t appear to act the same. Take the pairs of masks 0 and 5, and 2 and 6. Each respective pair should be identical (masks 0 and 5 are MG, and 2 and 6 are RGB), but with Mask Strength set to 1.0, Mask Low Strength set anywhere between 1.0 and 2.0 (there seems to be no difference between any of the values within this range), Lottes MaskDark set to 0 and Lottes MaskLight set to 1.0 (any more than that and clipping occurs), and all else equal, you get different results.

Here’s Mask 0 at full mask strength:

And here’s Mask 5, also at full strength and with mask low strength set to 1.0 (again, anything higher is identical):

The latter is a bit brighter, for some reason, and this also occurs with masks 2 and 6.

I’ve found that if I comment out the following line, however, then Mask 5 looks identical to Mask 0, and so do masks 2 and 6:

mask = clamp(mix( mix(one, mask, mcut), mix(one, mask, maskstr), mx), 0.0, 1.0) * dark_compensate;

Of course, then the mask strength parameters stop working altogether for the masks that employ this code.

So my question is: is this behavior correct? Which masks have it right: masks 0 and the Lottes masks, or the other masks that are hooked up to the Mask Low Strength parameter?

2 Likes

Thanks man, I’m glad my results meet with your approval :slight_smile: I too think this could help new users because there are quite a few pitfalls to run into when setting up these shaders in WinUAE. I knew I gave it a try once years ago, but I quickly gave up because I didn’t really know what I was doing and the results looked like crap (of a fault of my own)… :wink:

If you don’t mind, here’s a few minor suggestions for the WinUAE shader pack. Fixing these would require minimal amount of work and it would improve them a lot, in my opinion:

  • In the colour profile section I had to link to the readme of your new shaders for a description on how the colour profile shader work. I think it would help people in the future if you included that information in your WinUAE shaders repository.

  • Like I wrote, the saturation control in the WinUaeColor reshade filter is broken (it applies the saturation after the target colour profile has been applied; that’s wrong and leads to some very funny results even at moderate settings; it only works as intended if no colour profile emulation is being used). Would it be possible to fix that? I’ve offered a workaround in my article (just use another saturation shader before your colour profile filter), but it would be nice to have it all in one shader.

  • Your colour contrast control, on the other hand, works very well. Would it be possible to add a brightness control as well? Then with the fixed saturation control we’d have brightness, contrast and saturation in a single ReShade shader that’s easy to adjust on the fly, like on a real 1084S.

  • Maybe include some comments about what the differet mask types are, how the mask controls work, etc. in WinUaeMaskGlow (even just putting that info at the top of the shader code as a block comment would help). It took me a good half an hour of inspecting the code to figure out how all those controls interact, which control applies to which mask type, etc.

I could give these a go myself, I just thought you might have 1435 different brightness and saturation formulas lying around already, so it would be like a 10 minute fix for you :slight_smile: Like I said, relatively minor things, but for newcomers these can be actually quite confusing and some might just give up in frustration.

Thanks man, glad you liked it.

Main reason is I’ve been using WinUAE for about 20 years now :sunglasses: I’m really used to it and I’ve perfected my configuration so it’s just how I like it. So if RetroArch misses 10% of the features I’m using in WinUAE, I’ll be quite pissed off… I’m like that :slight_smile: Besides, PUAE being a derivative of WinUAE doesn’t bring anything new to the table, by definition — it’s playing catch up, at best. The only reason why I’m considering RetroArch is because of Guest’s new shaders, plus a few home-computer emulators I sometimes use don’t have shader support (ZX Spectrum, Armstrad CPC and BBC Micro).

Some of the technical reasons why RetroArch might be a hard-pass is that WinUAE has lagless/beamracing vsync support (although I’m more of an RPG/Adventure gamer, but Pinball Dreams feels just too laggy with normal 50 Hz vsync). Another one is I don’t think it supports the PFS3 filesystem for HDF images (much more reliable than the default Amiga Fast File System (FFS)).

Having said all that, it is surely a nice option for newcomers; you just point it to some WHDLoad packs or ADFs and bammm, it works. But then, I’m a bit particular in my preferences; I don’t even use WHDLoad that much, I prefer to install games using their official HD installers onto an Amiga 500 / Kickstart 1.3 / HDD system myself :sunglasses: Don’t know how good RetroArch is when you’re interacting with the OS like on a real computer and don’t just use it to launch games. I guess I’ll find out in the future when I’ll get to it.

3 Likes

It somewhat roots in the legacy and the process of the shader development. I’m currently happy with the mask options and it’s unlikely to change, also to not mess with the existing presets. Maybe i could add the ‘mask low’ strenght controls to masks 11 and 12, because this de-facto means better control.

As i mentioned, the ‘duplicated’ masks have different control parameters and different purposes. You can easily check it out with the default settings while switching masks. Lottes masks have a bonus allowing maskBright value over 1.0 out of the box and are quick-setup friendly. There is even more redundancy you missed like Lottes mask 4 can be achieved with mask 2, increased mask size and mask shift, mask 12 can be achieved as mask 11 with the BGR panel setting…

There is a learning curve on the shader, tweaking habits etc. As i mentioned, i’m happy that some same mask layouts exist, but work differently.

You have to do brightness compensations manually with masks which don’t compensate, so basically the user must make it correct by applying other brightness settings. To eliminate some redundancies is not a priority here. For example, if an user likes lottes masks and tries this shader, then it’s very easy for him to continue etc.

About the screenies, yes, masks 0 and 5 look quite alike with full mask strengths, but that’s it. Mask 5 is a ‘trinitron mask’ which leaves visible ‘phosphors’ gaps on darker phosphors. Personally i prefer ‘normal brightness’ on the screen, there’s the BFI option etc. which makes full strength masks to lose to much brightness, not to mention the slotmask. Keeping the main mask strength below 1.0 is very common though.

3 Likes

Did the opacity adjustment and it was a game changer to see what my choices were doing in realtime. TY again for pointing this out.

2 Likes

I wouldn’t normally reply to such an old post, but (if you’re still reading this forum) do you remember what settings you changed to eliminate the moire while retaining curvature?

1 Like

@PizzaLaser25 My go to values are the one’s recommended from the shader -that is 0.03 for X axis and 0.04 for the Y axis. They provide a nice compromise between the intended look and a moire free experience. But feel free to experiment and see what suits your taste!

Ah that makes some logical sense - as the “defaults” they should be moire free - maybe I just pushed the curvature too far to better align with the particular overlay I’m using.

Would integer scaling eliminate moire, even with large(ish) curvature values?

1 Like

No, curvature breaks the integer-ness by virtue of being curved :slight_smile: Quoting myself from earlier in the thread:

2 Likes

I read that post by you last night, searching the thread for the word “moire” – and now, with this additional comment about curvature “breaking” the “integer-ness”, it all adds up for me.

I checked back and forth between Hyllian Curvature and Guest Advanced and both of them exhibit some moire when curvature is introduced. I’m not sure which is better.

I guess there are 3 options for this:

  1. Integer scale 4:3 and no curvature. Would eliminate moire and uneven scanlines, but would limit choice of overlays to those which are only on the sides, not a full bezel.
  2. Custom resolution and X/Y position with “flat” overlay. Would eliminate moire, but maybe not uneven scanlines. Would open up more overlays to include full bezels.
  3. Custom resolution and X/Y position with any overlay. Would introduce moire and uneven scanlines, but would allow any “shape” of bezel.

I am starting to lean towards Option 2. I think I want there to be some sort of “full TV bezel” for immersion, and I think it’s easier to account for/reduce uneven scanlines than it is to eliminate moire.

2 Likes

I may be re-stating one of your existing options, but you can always just slap a “curved” overlay over the top of a non-curved image and let it block out the corners. Most curved TVs did this to some extent anyway and developers were typically smart enough to avoid putting mission-critical data in these areas precisely because they might get blocked/cropped.

1 Like

Yeah, that is more or less “Option 2” - it occurred to me as well after I wrote it that there is no reason why an overlay with some curvature could not be used.

Ultimately, I think I’m willing to let the very slight (0.1 - 0.2) curvature go because once I see the moire, I can’t see anything else. I think the minor curvature of the bezel will convey enough of the immersive aspect that I’m going for.

If it turns out that there’s any necessary info in the overscan, I can always adjust and save a game override. If anything, I’m guessing I’m more likely to find games that have garbage at the edges of the visible area which I will need to push further into the overscan (and will also need a game override for).

1 Like

Thanks for this link - I will try some of these mitigation techniques later tonight! The moire I am getting is minimal - maybe one or two of these tricks will help!

1 Like

Gave some of these a try last night finally. Noise is definitely a way to fully eliminate the moire, but I didn’t like the look of the noise.

I think for me the solution is going to be to give up curvature and then pick whichever shader gives me the most even/natural looking scanlines. The contenders are Guest Advanced, Hyllian, Easymode and Zfast in that order.

The biggest remaining issue I’m tinkering with is trying to remove what I think is meant when people say uneven scanlines - basically the very subtle appearance of horizontal “stripes” created by 3 or 4 scanlines in close proximity seeming to band together or maybe just appear slightly closer to one another or more prominent, which is visually distracting. I am relatively confident I can eliminate this by playing with the scanlines settings inside Guest Advanced to just slightly soften the scanlines.

1 Like

Tbc, lightening up the scanlines and/or mask will help with your moire issues (some). And you’re right noise helps, but that opens up a whole other can of worms. (Namely being you usually need to use a distracting amount of noise to “remove” the moire, which kind of defeats the purpose imho, as you’re removing one distracting thing for another)

2 Likes

Oh interesting, I hadn’t thought about how lightening the scanlines and lowering the mask strength would reduce moire, but that does make sense since it is the lines themselves that appear to warp with the moire. I am probably about 95% to where I want to be just by using any of the shaders I mentioned, without curvature - so if I can get one of them to even out the striping/clumping/banding/unevenness to a place where I am satisfied, through a little lessening of those two parameters you mentioned, then I will toss some curvature on just to check and see if that is resolved as well. If yes, awesome. If no, then I’ll just give up on curvature.

1 Like

This is an exerpt from another post I’ve made concerning moire mitigation. If using Non-Integer Scale try to match it to an Integer Scale percentage that produces the least or no moire. You can fine tune the noise resolution and amount so that it’s barely noticeable but still helps hide/diffuse the moire.

Have you tried my preset pack by chance? There are some curved presets using MBZ__3__STD that should look pretty decent. I also started making a preset using GDV-Mini but there was a bug in the shader or in Mega Bezel that stopped me from proceeding further. That bug seems to have been resolved now though.

I observed the same Castlevania: SOTN startup loop for a bit and I had earlier noticed that when the screen fit the bezel, the Non-Integer scale was around 66% while when it exceeded the bezel it was around 77%.

This can also be seen in the screenshots I posted.

So I thought I’d use the Non-Integer Scale instead of the Integer Scale along with (HSM_INT_SCALE_BORDER_MIN_HEIGHT) to sort of lock the scale factor to a setting that matched the setting that was set when I used Integer Scale Mode 0 (which didn’t have the moire issue).

Guess what? It actually worked! I was now using Non-Integer Scale (Int. Scale Mode 0) with my rich scanlines with no moire pattern in 640 x 480 res mode!

For Castlevania: SOTN the perfect setting was 66.40! 66.60 was also acceptable but 66.40 had 0 horizontal moire! any setting above or below that resulted in noticeable moire either in a convex or concave pattern depending on if I was above or below the ideal setting. the further away I went the worse the moire pattern.

Suggestion for Automatic Int. Scale Offset to minimize moire without sacrificing well defined scanline patterns.
1 Like

Iv’e been experimenting with stronger masks lately, suppressing my autistic obsession with color retention just enough to get some results… until I can’t.

On one hand it’s undstandable that laying stripes of transparent color ontop of an image… may affect the color of said image.

On the other hand I am absolutely baffled how i’ts aways a greenish tint that even appears with the black and white mask 7 for some reasion, on both displays I’ve used the past two years at all resolutions with scaling set to 100%… but not mask 8. Sadly mask 8 is just ugly.

Despite not having a 2k (I use 4k) display I get some pretty decent results from masks 11 and 12. This gives me a theory; let me get straight to the point.

Im requesting a CMY (maybe CMYB?) mask. Despite our fundamentaly additive displays, perhaps applying a mask over an image is a subtractive afair that calls for the subtractive color model?

I don’t know if this has been brought up before; I only ran a rough check with the searchbar.

Do you still get this greenish tint when you flip the mask layout?

What mask size are you using and what colour format are you using on your computer? Is it 4:2:0 Limited or RGB 4:4:4 full? Have you tried Mask 6 size 0 or 2 with layout 0 or 1?

Have you adjusted any other color settings? Do you use Grade? What are your Gamma Settings like? What white point are you using or NTSC Phosphor Gamut? Is your display calibrated to sRGB or DCI? What colourspace are you using in the shader?

Are you using Deconvergence? If so, have you manually adjusted the settings?

These are all things that you can look into first that might affect the colour output.

Feel free to post some screenshots, including some close-ups and you can also take some photos of the screen with the following settings: ISO 100 or 200, White Point 6500K and Shutter Speed 1/60 or 1/50 corresponding to 60Hz or 50Hz refresh rates.

You can also post your shader settings in the forum.