New CRT shader from Guest + CRT Guest Advanced updates

I like clamping the glow vertically and letting it expand far out horizontally. It prevents the images from losing to much in the blacks while looking kinda anamorphic lens flare-ish when it shows up. In general I like how it blends in more.

5 Likes

I like the scanline brightness changes. It makes sense to not auto-burn some tints.
I could get the same results I had before with scanlines type 2 by rising the dark pixels boost to 1.75.

New glow is looking really nice too. I thought it was rather artificial before with every shader I tried.

I wonder if you can add a sharpness filter for the NTSC preset.
What I’m trying to reach is something not looking completely blurry, more like a TV with a “sharpen” option, and also fighting the linear resizing that happens through the ntsc passes and make the black tones larger.
That’s what gamma linearization usually does but it’s not possible here with the yiq transformation.

That’s what I have at the moment with
the 2 ntsc-adaptive passes +
horizontal dilation (hack of warp/smart-morph to enlarge and blur the lighter pixels horizontally only, a “fake linearize”) +
sharpen/shaders/fast-sharpen +
crt-geom:

…ntsc-colors too in that shot in svideo mode.

3 Likes

This looks really good. Most NTSC emulation is a bit more extreme than what I remember, I think because it’s emulating all the artifacts as if the TV has no comb filter.

Mind posting your settings for this shot?

I’ve been trying to make two presets, a pro monitor setup and a consumer/composite setup, without masks, similar to what you’re doing. You gave me some good ideas!

1 Like

There are some ‘features’ with the NTCS preset x-scaling, i tried my new g-sharp resampler to scale the x-resolution down to original (scale_x# = 0.5 repeated again) and used the gdv-standard pass instead.

Not minding the NTSC artifacting, the image looks quite better imo than setting the x-scale of the 2nd NTSC pass to 0.25 directly.

2 Likes

Here is a portable version as there’s some modifications.

https://mega.nz/file/J400hLDC#s6lToKibBLiGZG5us8-A3mPA8xPizlIKOo4Y1SmyAN4

1 Like

I tried scaling back with interpolation/aann (0.5 after the 2nd ntsc pass). No more dilation with morph.
It gives an interesting result but can produce grey shadows like on your pic around stuff on a bright background.

Good tests to check for problems are super mario world, Mario eyes, also 1st Sonic eyes and bottom-left face icon on Megadrive.
Mario right eyes on the map is a bit smaller than the left one with that aann method. It’s great and clear while playing though.

Also it’s not great for the fringing, artefacts effects of composite.

4 Likes

This looks really nice!

2 Likes

The effect looks good but it’s really throwing the colors off in a bad way when I tried using it; what settings are you using?

The only thing I did was add the pass and left it at default. I am using Mask 0 and enabled the 4K setting. I’m guessing you’re @ 1080 so maybe it doesn’t work as well?

The effect itself looks good after I reduce the dithering size to 0.50, but it has a disappointing effect on the colors which I haven’t been able to fix yet.

@Tatsuya79

I think I’m starting to see what you mean about using Outrun to test brightness/contrast; when I do this, I notice other NTSC-J games will have too much contrast in highlights and some highlights won’t blend properly as a result.

The more you know!

There are a lot of details in Demon’s Crest that get mishandled by subtractive sharpness, I’ve noticed.

subtractive sharpness 1.00:

no subtractive sharpness, horizontal sharpness 4.00:

I’m trying to figure out how to avoid this while still keeping black lines sharp.

1 Like

You can try increasing ordinary sharpness. Newer versions are less sensitive to this effect, but it still occours with some settings.

1 Like

I compared with crt-geom, and the same pixels tends to “disappear”. They’re blurring together and perhaps that’s what should happen on most crt screens too?
When every little dark pixel gets too obviously visible, the shape of edges seems to widen a lot, even more than on the raw pic, making stuff looks a bit flat.

raw:

crt-geom:

crt-guest 3.6/1.0:

crt-guest 5.0/0.0:

(check main char, gargoyle statue edges)

1 Like

@Tatsuya79

Afaik, the pixels that disappear should blend together with the adjacent pixels instead of disappearing. Instead of going grey - black - dark grey it should go grey - dark grey - darker grey. To clarify, I’m talking about single pixel details seen in the shaded image and not the raw pixels output by the console/emulator.

At 4.20 the effect is gone, but at this level you can just turn off subtractive sharpness and black lines will still be acceptably sharp IMO.

4.00

4.20

4.40

@guest.r I noticed some weird results with the interlace setting 1 and 2.

Below is a 640x400 testimage, it alternates black and yellow lines. If you load it up in the image viewer (make sure to use integer scaling) you’ll notice only interlace setting 0 and 3 give a correct result. But 1 and 2 give respectively epileptic seizures (setting 1) or an almost completely yellow screen (setting 2). Is that expected behaviour?

Not related to the above, is there a possibility to create a separate horizontal sharpness setting for interlace mode? I noticed in the UAE core when using the hires shader (with UAE core option set to horizontal resolution automatic (which is 720 pixels) that with low horizontal sharpness it works perfectly for games, but in interlace mode for pictures that horizontal sharpness is too low. This could be because game resolution is simply doubled horizontally in 720 pixel mode, while interlace pictures have real high horizontal resolution. For my personal preference it could easily need double horizontal sharpness setting in interlace mode, but unfortunately it cannot be set separately for interlace mode. Could this setting maybe be added (or if difficult, a multiplier parameter that multiplies horizontal sharpness with a integer multiple when in interlace mode)?

interlace-test-picture

That’s a linear space interpolation characteristic. It’s endorsed by the implementation, which blends the lines a bit, so there are no harsh transitions. In general, you have to press the ‘P’ key with mode 1 to see, that if in the current frame odd lines are displayed, the next frame displays even lines. Mode 2 is baked interlacing, because you can make screenshots, play 30fps content, etc. Mode 3 is if mode 2 is too smooth.

I realize the situation. But adding more codepaths or parameters would increase the entropy of the shader and it’s a bit high already (=shader doing it’s own things -> chaotic situation…). Maybe you see it differently because switching to interlace mode is more common with amiga games, but i know only few, like Outlander, Unreal, Lionheart, Hired Guns is more like doubled lines already. Currently the mechanism to prevent such things is using ‘internal resolution’ to scale to 240p. I know it would mean seamless gameplay in some cases, but it’s a decision which, like i mentioned, has weights on both ends.

2 Likes

Do you have an example game where I could observe the use of setting 1 and 2?

I understand you’d rather leave the shader as it is right now (I know it’s very much finished and great :slight_smile: ). I like interlace mode setting 3 a lot. But sometimes I miss the judder from real interlace, and I also wonder whether brightness for mode 3 isn’t too high compared to real CRT (which would alternate odd and even lines every other frame). I think the emulator present this image as a composited interlace image of double resolution.

Would it be much trouble to add a mode 4 that is just mode 3, but it blanks the odd lines in odd frames and blanks the even lines in even frames? I think this would simulate the real judder from interlace on vintage systems. Bonus would be if the percentage blanking to black could be set also :slight_smile:

Not sure if I understand that fully. It would be worthwhile to have higher horizontal sharpness for interlace mode pictures. What I mean is a setting that enables:

if (interlace) h_sharp = h_sharp * 2

Would that be possible, or maybe have some hack code that I could add to the hires shader? Just asking, if it’s not easy to do I’m fine with the way things are now :slight_smile:

1 Like

Mode1 = Mode4 already, since mode 3 does linear blending. I’m not planing to add hard lines though, and a brightness reduction hack is already implemented for interlacing on. But it’s true that interlacing in gdv works better with stronger masks. The only thing i can do is to blend in reference space, not in linear space, which is a nice idea.

if (interlace) h_sharp = h_sharp / 2, :grin:

substractive sharpness has it’s quirks etc. It’s definitely a solution which increases entropy, that’s why i have no issues to blend interlacing in non-linear space to decrease brightness for example, because it doesn’t cause confusion or require special handling.

1 Like

Yes I think the UAE core may output interlace differently. I think UAE caches two subsequent odd and even, compositing one frame of these odd and even (= double resolution) and outputs that.

I don’t think mode1=mode4 already for the UAE core, it’s very different from what you think the output is. Please test my test picture from previous post in image viewer. It illustrates the issue quite well as the result is similar in the UAE core. (I understand other cores may do interlace output differently and you haven’t tested with the UAE core yet?)

Mode 1 gives either a full black OR a full yellow screen as a result. This is alternating full black and full yellow frame strobing, it is not interlace, and cause epyleptic seizure with my test image, please try the image with RA load content, it will open the RA image viewer by itself. Have scaling integer and see what mode 1 does. I challenge you too take a concentrated look for longer than a minute :exploding_head: .

Again no worry if you’d want to keep things as is, mode 3 is working fine for my purposes, it’s just that I want you to be aware of these cases :slight_smile:

OK but where do I put this in the shader code? And how/where do I turn it off when interlace mode is stopped again.

1 Like