Shader curvature and moire

Hi guys! long time no post.

I’ve been having problems with almost all CRT shaders that have a curvature to them, which is the moire effect whenever the screen is bright. Initially i thought this was due to the fact that i wasn’t using integer scaling, but even with it on I am still getting a very noticeable effect. The only fix i’ve found for this was increasing the resolution way past my native res, but that’s not exactly ideal. Turning off Crop Overscan doesn’t seem to help.

!

Is there a way around this problem?

Not that I know of. There are a couple of shaders, like crt-geom and crt-royale (the Cg version where the curvature works, that is) that do some magic that I don’t really understand that mitigates it, but I don’t know of anything that can be done on an as-needed basis.

I figured as much. Another shader that doesn’t suffer from this problem as badly is CRT-Lottes. I’'ll stick to these for now. Thanks you hunterk!

Moire should depend on what combination of shader parameters and screen resolution you have. The default values are probably optimized for a 1080p screen without integer scaling which is probably the most common setup.

As a feature request then, it would be nice to have the shaders suffering from this moire problem be pre-configured for say 1080p, 1440p and 2160p with integer scaling on/off. That means every preset now needs 6 or 7 versions of parameters to cover these three resolutions to avoid moire. It would maybe be better to put the different versions of the same shader as toggle options so these still only takes up a single line in the menu? So you select a shader as usual but can then push right or left button to toggle through different parameter-presets as well… For example then crt-lottes-multipass [-default] [-1080p] [-1080p-integer] [-1440p] [-1440p-integer] [-2160p] [-2160p-integer]. I guess it could be automated but that would require some type of script and even then as soon as you change anything like curvature, you will get a different moire pattern and would need to manually tweak it again…

I got some moire at first with crt-lottes-multipass but I eliminated it by lowering Hard Scan to -7 instead of default -8 for my configuration, also I made sure both shader passes were set to Linear scaling and I wanted curvature bumped up a bit too. Just try some different parameters and you might work it out! If you disable integer scaling or have a different resolution you need to tweak it differently. Anyway this is for my Shield Android TV so you might need to change the file paths if you want to load this config. These paramaters have no moire for me I’m using a 1080p TV with integer scaling enabled (with a nice looking overlay).

“lottes-2pass.slangp” (placed “shaders” folder):

shaders = "2"
shader0 = "/data/data/com.retroarch/shaders/shaders_slang/crt/shaders/crt-lottes-multipass/bloompass.slang"
filter_linear0 = "true"
wrap_mode0 = "clamp_to_border"
mipmap_input0 = "false"
alias0 = "BloomPass"
float_framebuffer0 = "false"
srgb_framebuffer0 = "true"
shader1 = "/data/data/com.retroarch/shaders/shaders_slang/crt/shaders/crt-lottes-multipass/scanpass.slang"
filter_linear1 = "true"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = ""
float_framebuffer1 = "false"
srgb_framebuffer1 = "false"
parameters = "hardScan;hardPix;warpX;warpY;maskDark;maskLight;scaleInLinearGamma;shadowMask;brightBoost;hardBloomPix;hardBloomScan;bloomAmount;shape"
hardScan = "-7.000000"
hardPix = "-3.000000"
warpX = "0.040000"
warpY = "0.060000"
maskDark = "0.500000"
maskLight = "1.500000"
scaleInLinearGamma = "1.000000"
shadowMask = "3.000000"
brightBoost = "1.000000"
hardBloomPix = "-1.500000"
hardBloomScan = "-2.000000"
bloomAmount = "0.400000"
shape = "2.000000"

I don’t think there’s anything optimized for a particular resolution as scanlines get curved and integer won’t be much help about that.
It needs to be a bit blurry to smooth the result.

With crt-geom define USEGAUSSIAN and comment out OVERSAMPLE to have the minimum amount of banding.
You might want to disable DOTMASK and not change brightness or scanline strength too much as well.
Bloom should really be avoided too.

I am having a similar issue with CRT-Royale.

I use the Geom = 2, and View Distance = 1 settings

The lines are accurate, in that a real CRT does this (very noticeable on a static image, less so in normal use) so I suspect the moire is intentional in shader, but too prominent.

Is there an option for CRT-Royale where I could dial it back 50% or so?

Apologies for my ignorance, I just don’t know the name for this effect, and googling “bendy lines” doesn’t yield many results

Try messing with the antialiasing parameters.

It’s not an intentional effect, just something that naturally happens both IRL and in the shaders.