CRT-Guest-Advanced, HD and NTSC for ReShade!

thanks! here what I get

and yes, the mask look kinda off, also there are a blur with Resolution_X =720, even with 960 is kinda has blur compared to previous solutions

how the retroarch deal with it? maybe just use crop in the mask part? since the crt mask is the same in both 4:3 and 16:9 in Res-O-Matic and retroarch

The only difference I can think of is that in RetroArch the last pass (deconvergence.slang) where the MASK (and many more like - Border, Corner and Post Brightness etc) calculations are done, is rendered out to a Texture the size of Viewport (Output Size).

And if I do the same in ReShade (render out the last pass to a texture), instead of rendering it out to the Backbuffer. This happens (MASK and many more effects don’t work) -

(This is the same preset that I posted screenshots from in my last reply to you.)

If you still want a AspectRatio shader that you can use with other shaders (this will still mess with some effects like CRT Masks). I made one (code blatantly stolen from CRT-Royale ReShade Port) -

#include "ReShade.fxh"

#define OptSize float4(BUFFER_SCREEN_SIZE,1.0/BUFFER_SCREEN_SIZE)

#ifndef AspectSize_X
#define AspectSize_X BUFFER_SCREEN_SIZE.x
#endif

#ifndef AspectSize_Y
#define AspectSize_Y BUFFER_SCREEN_SIZE.y
#endif

#define SIZE_S00 ReShade::BackBuffer

static const float2 boxsize=float2(AspectSize_X,AspectSize_Y);
static const float2 expanse=boxsize/ (2*OptSize.xy);
static const float2 capital=0.0/OptSize.xy+0.5;
static const float coord_w=capital.x-expanse.x;
static const float coord_e=capital.x+expanse.x;
static const float coord_n=capital.y-expanse.y;
static const float coord_s=capital.y+expanse.y;
static const float2 correct=float2(coord_w,coord_n);

void CropProcessVS(in uint id:SV_VertexID,out float4 position:SV_Position,out float2 texcoord:TEXCOORD)
{
	#if __RENDERER__ <= 0x09300
	texcoord.x=(id==1||id==3)?coord_e:coord_w;
	texcoord.y=(id>1)?coord_s:coord_n;
	position.x=(id==1||id==3)? 1:-1;
	position.y=(id>1)?-1: 1;
	position.zw=1;
	#else
	texcoord.x=(id&1)?coord_e:coord_w;
	texcoord.y=(id&2)?coord_s:coord_n;
	position.x=(id&1)? 1:-1;
	position.y=(id&2)?-1: 1;
	position.zw=1;
	#endif
}

float4 StockPassPS(float4 position:SV_Position,float2 texcoord:TEXCOORD):SV_Target
{
	return tex2D(SIZE_S00,texcoord);
}

float4 RatioSizePS(float4 position:SV_Position,float2 texcoord:TEXCOORD):SV_Target
{
	const bool margins=float(texcoord.x>=coord_w&&texcoord.x<=coord_e&&texcoord.y>=coord_n&&texcoord.y<=coord_s);
	const float2 boxcoord=((texcoord-correct)*OptSize.xy+0)/boxsize;
	const float4 boxcolor=tex2D(SIZE_S00,boxcoord);
	return float4(margins*boxcolor.rgb,boxcolor.a);
}

technique Aspect_Crop
{
	pass
	{
	VertexShader=CropProcessVS;
	PixelShader=StockPassPS;
	PrimitiveTopology=TRIANGLESTRIP;
	VertexCount=4;
	}
}

technique Aspect_Size
{
	pass
	{
	VertexShader=PostProcessVS;
	PixelShader=RatioSizePS;
	}
}

Just drag Aspect_Crop to the top and Aspect_Size to the bottom in the ReShade menu. Then use AspectSize_X and AspectSize_Y to change the ratios.

2 Likes

@DevilSingh what about making OutputSize_X and OutputSize_Y crop the input for CRT-Guest (CRT-Guest will see it similar as Res-O-Matic method) but for the final output alpha (invisible) border will be added to pad the CRT-Guest output to the screen resolution?

Sorry. But I don’t think I understand your question here. Can you clarify what you are asking for?

Aspect ratio shader should work with horizontal tweaks if it’s put in the chain before guest-advanced.

If it’s applied later, then ofc. masks would be distorted.

2 Likes

Wouldn’t that be pointless? Then the Aspect Ratio shader will just behave like a crop shader only -

It’s not like CRT-Guest can access this cropped area to output to. We need something that can actually change the backbuffer size.

This is exactly what the Aspect Ratio shader does. (Other than adding alpha at the end.)

Aspect Ratio OFF -

Aspect Ratio ON -

I meant that as a CRT-Guest update to do this internally (Not literally, but as a general idea) so the crt mask will not be distorted, In other words make it kinda act like retroarch

Okay, so turns out I was being a dumbass (as always). Adding Aspect Ratio to the Guest shaders (or any shader) is easy. Please try this CRT-Guest-HD Aspect Ratio TEST.

See if MASK looks right for you too, and try to change both Resolution and AspectSize settings to random values to check if anything breaks.

Everything is working on my end -

1 Like

can you make a test for ntsc one too please?

CRT-Guest-NTSC Aspect Ratio TEST

1 Like

thanks! I get

Oops! Did a hasty copy/paste mistake. Find and replace CGHD_S09 with NTSC_S14.

so far so good! seems work fine! thanks!

and here was the 960 hack https://forums.libretro.com/uploads/default/original/3X/7/0/701aedbce0dcff35033df9945d004b3751907ba4.jpeg for comparison

both has similar sharp which is similar to retroarch too

didnt test the borders in ntsc but it seems work fine in CRT-Guest-HD from my test before you post the ntsc update

1 Like

Can you check if scanlines (and everything else) looks fine on your end, when you change Aspect_Y.

I have to get something 240p in this case but I will try to test them

Hey, so I’ve recently got into CRT shaders for emulation (specifically PCSX2), so this may be a dumb question, but what value do I need to put into the CRT Guest Resolution_Y and Resolution_X? From the screenshots shared here, it looked like Guest-Advanced would look fine with default settings, but when I try using it like that on PCSX2, the games gets so blurry I can barely read any UI text. I took some screenshots and made an Image Slider for comparison (between no shader, CRT Royale and CRT Guest): https://imgsli.com/Mzk3ODU1/1/2 I’m trying to find alternatives to Royale because it crushes black levels, in games like Rule of Rose (that are naturally darker), I can barely see a thing in some rooms. I’m also normally playing at the PS2’s native res, I just bumped it to 4x for the sake of clarity when taking the screenshots.

For reference, I use Guest-NTSC on Duckstation (it came with the emulator when I downloaded it), and the only settings I changed there were NTSC Resolution Scaling from 1 to 2 and High Resolution Scanlines from 0 to 1, and in Duckstation it looks gorgeous (example: https://imgur.com/a/qm6qaSh). I tried using Guest-NTSC on PCSX2 and changing those two settings as well, but it still looks awful. Can anyone help me configure it correctly? Really don’t want to depend on Royale.

By default my Guest ports scale to 320x240 and if I’m not wrong Royale for ReShade scales to the full buffer size (so, 1920x1080 in your case).

You can try the same 1920x1080 in Guest or 960x540 for a softer look. And if you want scalines at those high resolutions you can adjust Internal Resolution Y: 0.5 | Y-Dowsample to your liking.