[REQUEST] crt-guest-dr-venom with interlacing support

I know, I know, I’m constantly asking for all of the things… BUT, I think alot of people would like interlacing support (if they’re like me and not the biggest fan of the (high TVL mode?) extra thin scanlines at higher resolutions).

I’m also suggesting that this be a variant version of crt-guest, as some will still want the old behavior available.

Really I can only think of about three solutions for thin scanlines at higher internal resolutions (I understand that the shader was written with this mode in mind; thin scanlines/high v-resolution).

  • Solution 1: Use a stock shader pass to force 240p. (Personally really dislike how this ends up looking.)

  • Solution 2: Add some form of interlacing to the shader. (Ideally as part of the main/final pass, with similar setting to the interlacing.glsl’s scanline brightness (maybe calling it the wrong thing?) but raising it reduced the flickering appearance.)

  • Solution 3: Do something similar to what crt-hyllian-3D does (raising the “scanline resolution”), @guest.r I still have that hacky prototype from forever ago for this, from what I recall the only issue with this, was that the mask ended up doing some weird stuff, like it wasn’t scaling properly (kinda looked to big) or something (if it’s the mask doing weird scaling, this could be an easy fix… I’ll look and see if I can get it working properly.)

Ideally option 2 or 3 would be the best solution for this (problem?).

2 Likes

@guest.r So I made some progress on option 3.

I’ve gotten this working what seems like correctly, on my nonsense (modded) version of guest-venom.

Now I guess all I have to do is port that over to the most recent version of crt-guest-dr-venom, and figure out the best way to make a setting in the shader so you can match which IR the game is at 2x, 3x, 4x, etc (like hyllian-3D). This way there doesn’t need to be 8 versions of this increased resolution shader, one for each resolution multiple would be a nightmare.

1 Like

Been tinkering with interlacing a bit and sometimes it gives very interesting results. It’s a bit of a straining thought though to combine it only with the regular preset.

In order to get the effect something like this must be added into the shader:

float line_no  = floor(mod(float(OGL2Pos.y),2.0));  // change y with x for TATE
float frame_no = floor(mod(float(FrameCount),2.0));
color = mix(color1, color2, abs(line_no-frame_no)); 

Add it after the line:

vec3 color = color1*w1 + color2*w2;

You can also add an parameter and use IF…

Ofc. the vertical effect is quite hard. To get sweet results with some games, the preset must be altered. Last shader (crt-guest-dr-venom) goes like this:

shader10 = shaders/guest/crt-guest-dr-venom.glsl
filter_linear10 = true
scale_type_x10 = viewport
scale_x10 = 1.0
scale_type_y10 = source
scale_y10 = 1.0 

Unfortunatelly, a screenie only shows an odd or even frame, but some games look nicely vibrant.

2 Likes

I’ll test this out after I wake back up XD.

This is cool though, thanks for taking the time and effort out for this!

2 Likes

@guest.r Quick follow-up do I need to use the preset code for this to work, or is the preset addition just to make some game look better when using interlacing?

1 Like

No, the preset is intended for ‘pure’ hires content for nicer interlacing. Shader can’t switch output resolution on the fly, so it’s needed to make some games look better than with regular preset.

So are you saying it should look fine for some games with the original preset but other games will look better with the new preset?

Sorry your wording is throwing me.

1 Like

Vertical resolution matters here. The adapted preset is for hi-res content, because linear resizing to display size is not to blurry. It’s not for snes or gba. :wink:

Original preset operates in output resolution and very hard vertical scaling. Since we don’t use scanlines for smoothing the content but interlacing, the image vecomes quite hard.

In short terms, interlacing looks nice with adapted preset and hi-res games. Other combos with interlacing aren’t nice.

1 Like

So does the interlacing cancel out the sharpness settings or are you just saying that using the altered preset allows default vertical (blurring/smoothing) so you don’t need additional code in the shader to fix it?

I understand that I need to use the preset when I want to use interlacing.

General sharpness settings are for horizontal sharpness, you can adapt them to your liking. In short terms, from left to right. Vertical sharpness is managed by scanlines and their concept of displaying a nice effect. Since we disable the scanlines effect and replace it with interlacing, the shader is not equiped to correctly add smoothness to interlacing with regular preset.

As i remember interlacing on my crt tv, vertical smoothness existed. So to just add interlacing is not correct, but only half of the job.

So the idea is to use an extra preset, because it’s quite easy to manage.

1 Like

Ok, then my new question is could the interlacing look better with the original preset with added vertical smoothing code?

No, it would not look better, maybe the same. :grin: And would be quite a challenge to patch the shader, so writing a new concept would be a better solution. The few PSX games aren’t worth it to use a complicated hybrid approach, since smart integer scaling can jump in.

Because we are talking about crt-guest-dr-venom, the adapted preset is simple and efficient. Crt-guest-dr-venom-interlaced shader would be also cool (with seperated mask pass), but the preset would also scale to 1x source and not 1x viewport.

1 Like

So this crt-guest-dr-venom-interlacing shader you’re suggesting, would it be guest-dr-venom with the interlacing code shown above added, the mask setup moved to its own pass, and instead of viewport scaling in the preset it uses source scaling?

1 Like

Something in the way. It would be very nice for 480i content and 2x res PSX games too. I would have to figure curvature though, maybe EWA.

Ofc. you can use the regular preset for PSX games, if you add a resolution check, something like this:

if ( mix(SourceSize.y, SourceSize.x, TATE) > 360.0)
{
        color = mix(color1, color2, abs(line_no-frame_no)); 
}
1 Like

What do mean by “figure” the curvature?

Lottes curvature cuts scanlines badly if used from already scaled image to viewport. Unusable untill i try something else. The intended shader would scale horizontaly to viewport before curvature is applied, so it’s not any more 1x1 source to viewport scale. It’s solvable i guess by using EWA or similar.

Hmmm that’s interesting, maybe the ewa filtering method is making the curvature work properly?

Next time I’m on PC I may try swapping lottes curvature in EWA to see what happens.

EWA is superior i think, if you manage to add a pass, it should do nice. :grinning:

1 Like

I honestly thought the “fancy make curvature not make the image moire” thing was from the ewa filtering itself, lol idk. Though I do personally prefer the curvature method in EWA over lottes.

A testing I shall go!

@guest.r

What’s going on with the Slang version of guest-dr-venom? (It seemed to get a fairly significant code overhaul, at least it seems like it at a glance.)

Some quick glances, seem to reveal some changes to the mask code (seems the application of the mask not the actual creation.), bloom written in a similar manner to guest-sm’s bloom, some changes to (subtractive sharpness, sharpness, and scanlines; these may be do to the interlacing changes though?) And some interlacing related thing (I think it just remove scanlines, no actual interlacing, I think lol.)

This was just a quick glance over things, like less the 2 minutes or so.

EDIT: After a more detailed look at it this is what I’m taking away from the update.

How the mask effect is finally applied is different, the sharpness stuff seems to be an adjustment to how it works (levels, etc.). I don’t think there’s scanline changes really (besides “make them disappear mode” aka the interlacing alternative feature, lol.) Also the bloom seems to be overhauled using guest-sm as a template, it seems.

1 Like