Questions about CRT Lottes shader

I’m a big fan of this shader and I use it for many consoles but I can’t for the life of me figure out how to make it flat instead of curved. I want the image to be like in this blogpost (image)

There is no Quark shader or Line 142 to comment to flaten it out in the .CG file.

In the .CG file what do I have to edit to make the image flat instead of curved?

My other question is why the shader looks gorgeous on 320x240 but looks weird on 640x480, is there something that can be done about that? The thing is some N64 games seems to be bigger then the usual native resolution (Perfect Dark) and CRT Lottes looks weird with it.

I have tried to change resolution from 640x480 in Core Options to 320x240 but Retroarch is crashing when a level is about to start in Perfect Dark.

Well that’s the ?s I had, thanks in advance.

To make it flat, edit these two params with value 0.0 on both:


#pragma parameter warpX "warpX" 0.031 0.0 0.125 0.01
#pragma parameter warpY "warpY" 0.041 0.0 0.125 0.01

#define warpX 0.031
#define warpY 0.041

About the resolution, for a CRT shader to show scanlines properly, it needs at least three times the original vertical resolution. So, for a game with 480 vertical lines you’ll need at least 1440 vertical lines for it to begin showing some scanlines. The ideal is to have five times the vertical resolution so that the shader can show its best features. This ideal would demand from you a vertical resolution of 2400, which means more or less 4k display.

1 Like

You can use this cgp (copy this text into a text editor and save it as something like “crt-lottes-downrez-flat.cgp”):

shaders = 2

shader0 = ../stock.cg
filter_linear0 = false
scale_type_x0 = source
scale_type_y0 = absolute
scale_y0 = 240

shader1 = shaders/crt-lottes.cg
filter_linear1 = false
scale_type_1 = source

parameters = "warpX;warpY"
warpX = "0.0"
warpY = "0.0"

It forces a vertical resolution of 240 px, which is what the CRT shaders expect, but lets the horizontal resolution go to whatever the core/you set it to. This seems to look pretty good on N64 but can cause some weirdness on other systems, so you probably want to set up an override for N64 that loads it instead of the normal one. Note: this only works with Lottes’ mask effects, which are independent of the horizontal resolution. If you wanted to switch to, say, crt-geom, you would need an absolute horizontal resolution set in there, as well.

A big thank you for answering my questions! Seems pretty straightforward, I’ll make sure to use that last fix for N64 only.

I also would like to mention that 640x480p games are technically having scanlines on real-life hardware, but they are so tiny that you cant see them anymore. So for games with a 640x480 progressive resolution, scanlines should be become obsolete like the real-life hardware does. I just would avoid scanlines for such games.

Other than that solution presented by hunterk, you can use crt-hyllian-3d.cgp too. It read the only half the input resolution, so it’ll show scanlines the same way.

Thanks again guys, it turned out great in the end and I love the results.

However there is a new ? that have popped up, games like Super Mario 64 and Super Mario World somehow looks too bright while games like Ocarina of Time, Majora’s Mask etc. looks fine. Is this a normal effect or supposed to be normal? Then again Super Mario 64 have bright colors to begin with.

CRT shaders darken the image quite a bit with their mask effects and scanlines, so they try to compensate in various ways, which can sometimes lead to clipping in very bright games. Many of the shaders include runtime parameters to adjust this sort of thing, though.