New CRT shader from Guest + CRT Guest Advanced updates

Come to the dark side…

4 Likes

The infinite contrast side is the best! :wink:

3 Likes

You mean like this?

1 Like

Terranigma fanart by SNAKEPIXEL with CRT-Guest-Advanced.

4 Likes

I’ve been trying to google and look at some of the thread for Real CRT vs shader comparisons and couldn’t find it. Did anybody do such comparison?

3 Likes

You mean like these?

4 Likes

Hi @guest.r, I’ve got a question about Mask Zoom: is it normal that it changes the subpixel layout, from 3 to 4? Because that’s what happens if I use “Mask Zoom: 1” on a Mask 6 layout. I think it wasn’t that way with the second implementation, when you still had the 0,5 intervals.

Also, there seems to be some kind of disalignation, which also happens with Mask 10, but less noticeable.

Zoom on those images to understand what I mean, it should be noticeable even with the compression.

Mask 6 (1440p):

Mask 6, Mask Zoom: 1 (1440p):

Edit: the disalignation (look at the inner thighs).

Edit 2: Mask 7 and Mask 9 seems to zoom (1) without issues.

Edit 3: switching from RGB to BGR layout for Mask 6, Mask Zoom: 1 fixed the disalignation. Don’t know why, but it worked. I leave all of this stuff here so it can be helpful to someone else.

Edit 4: even by switching to BGR when zooming the mask I experience disalignation. Blue gets in place but other colors, like violet, disalign. Weird.

1 Like

Yeah, this requires special handling at least. You can also try to downsample mask 12, maybe it works better. I remember having slotmask alignment issues and differences between different adapters in the past. It’s not bad to give it some attention.

Two more examples of downsampled mask size 2 mask 10:

Aperture:

Slot mask:

13 Likes

New Release Version (2023-06-04-r1):

Notable changes:

  • performance bug fix related with halation (thanks to @DevilSingh)

Download link:

https://mega.nz/file/toBGBAYR#9uljee1NWY4-9LUg09d1f3sfOROaYgeN3fXVF2hccZw

I would also kindly ask @hunterk for a repository update (this one is just copy-over also).

Edit: thanks @hunterk for the update. Newest versions are now available through the RA shader updater.

23 Likes

Yay! :partying_face: I hope we get more frequent updates on the repository.
Not only is it more convenient to update, but it’s also easier to check what changed between versions.

2 Likes

Nice. With this update I can remove the note in my thread about users needing to manually having to download your latest update since everyone can now get it simply by updating their slang shaders, until you drop another new update on us that is lol.

For anyone using my pack it works with my presets, I tested it and nothing is affected at all from what I see.

1 Like

@guest.r, I’d like to thank you for the amazing work that you’ve done with this shader. The depth of it is incredible. I’ve been playing with it for the last couple of weeks for 10-15 minutes a day, and I still have a lot to learn. Most of what I’ve done so far is explore the masks, scanlines, and parts of bloom/glow/halation.

To my eye, 8K and a display that put out a gazillion nits would be ideal, but I’ve found the mask zoom feature particularly interesting to increase TVL perception for systems where that look is more appropriate.

I wish the shader was documented, but it’s also been fun to play with the sliders and learn what things do. Below I’ve included a screenshots which I hope do your shader some justice.

8 Likes

Hello Guest, I was having a look at your fast grade shaders and saw some optimization tricks.

You can multiply linear transformation matrices to create a new joint matrix, maybe the same can be applied to other shaders of your pack but in pre-shaders.slang at line 315:

	color = (m_in*m_out)*color;

	color = clamp(color, 0.0, 1.0);

	color = pow(color, vec3(1.0/p));	
	
	if (CP == -1.0) color = c;
	
	vec3 scolor1 = plant(pow(color, vec3(wp_saturation)), max(max(color.r,color.g),color.b));
	float luma = dot(color, vec3(0.299, 0.587, 0.114));
	vec3 scolor2 = mix(vec3(luma), color, wp_saturation);
	color = (wp_saturation > 1.0) ? scolor1 : scolor2;

	color = plant(color, contrast(max(max(color.r,color.g),color.b)));

	p = 2.2;
	color = clamp(color, 0.0, 1.0); 	
	color = pow(color, vec3(p)); 
	
	mat3 warm = ToSRGB*D65_to_D55;
	vec3 warmer = warm*color;
	
	mat3 cool   = ToSRGB*D65_to_D93;
	vec3 cooler = cool*color;
2 Likes

Yeah, these two (warm and cool) can be pre-calculated since there are constant values involved. Otherwise mat3x3 * mat3x3 should require 3x more ops compared with mat3x3 * vec3. Nevertheless, an optimization is possible, thanks for the hint.

1 Like

‘color’ is a vec3 array variable so it’s like running mat3vec3pixels, if you precompute (not necessarily a constant) a mat3 * mat3 you save one mat3vec3pixels operation which is huge. Maybe try to profile them, not sure how though not an expert on shaders (fps?)

2 Likes

You still need to use resources for a mat3*mat3 multiply doing it on the fly. But you know the math…(9 dot products)

It can be done very fast due to parallelism, true, but mat3*vec3 should be simpler (3 dot products).

Moving it to the vertex shader should help indeed though, maybe it’s a good trade.

2 Likes

Hey, I noticed in the ReShade port the Integer Scaling setting also scales the mask and not just the game. I’m not sure if this is an issue on my end or intended functionality, but I’d like to request that it be fixed/changed if possible.

(Also just a friendly nudge to update the port in general, please!)

1 Like

For anyone interested I’ve ported CRT-Guest-Advanced, HD and NTSC to ReShade.

Some screenshots at default settings.

Advanced -

HD -

NTSC -

15 Likes

That’s amazing. I need to figure how to convert shaders to Reshade, I’ve gotten multiple requests to port my presets over there but don’t have the slightest idea on how to do it but your pics make me want to learn.

2 Likes