Crt-pi shader users - reduce scaling artifacts with these configs

this was developed for retropie and the crt-pi shader, but could be used for any retroarch install and shader (although you’d have to edit the files for the latter).

below is a dump of my instructions for retropie users, but hopefully this makes sense still :slight_smile:

one issue with the excellent crt-pi shader is that it’s shadow mask is always vertical, which causes a rainbow effect in vertical games. here’s an example:

fortunately, @davej created a ‘vertical’ variant which has a horizontal shadow mask, which fixes the issue:

the difference is more obvious at full-screen, but here’s it zoomed in:

crt-pi.glslp:

crt-pi-vertical.glslp:

this still isn’t perfect. the scanlines aren’t consistent. this can be fixed by usingvideo_scale_integer = true, which forces the game to be in multiples of the original resolution, but on most screens this leaves an additional black border on the top and bottom, where it doesn’t divide in exactly.

by using integer scaling on only the x axis, we can make a big improvement but still not add new borders. eg:

previous with crt-pi-vertical.glslp:

now:

What about horizontal games?

this same logic has been extended to regular horizontal games/consoles also, but not so obvious.

How to:

to implement this across all games for a system, you would normally have to manually create a new cfg override file for EACH game, and point it to the correct vertical/standard shader, and manually calculate the right resolution. i have saved you the effort :slight_smile: just extract the following files into the following directories:

1080p screen users

720p screen users

1280x1024 screen users

1366x768 screen users

Curvature version: If you want the curved CRT ‘barrel’ version instead, use the following. Note, this shader does not align with the pixels in the same way so the cfgs simply specify the vertical version or not:

if you have a different screen resolution, please either ask me to create you a new zip, or run the script yourself: https://github.com/dankcushions/crt-pi-configs (instructions in the script itself)

you can check it worked by loading a vertical game (eg, donpachi), accessing the RGUI via select+X or F1, quick menu > shaders > it should be using crt-pi-vertical.glslp, not crt-pi.glslp.

Requirements This requires Retropie 4.x. Users running a recent image should have no problems. Users with older images: If you update the setup script, and Retropie-Setup > Manage Packages > Core > Retroarch > Update binary. If it still doesn’t work after this, edit /opt/retropie/configs/all/retroarch.cfg/ and search for auto_overrides_enable and ensure it is set to auto_overrides_enable="true".

For the lr-nestopia configs, you must set the lr-nestopia emulator as your default NES emulator. lr-fceumm (the default) causes lag with the shader, even for an overclocked pi3.

Want to adjust the shader further? see this post by @dave_j

Special thanks: @dave_j who created the crt-pi shader. @UDb23 who created the resolution_db that my script uses to figure out the right scaling.

1 Like

Awesome, this is very cool. I’m working on a project that’s actually running at 640x480 resolution at the moment with many emulators set up at 2x integer scale. Sadly crt-pi doesn’t display well at this resolution - the shadowmask/scanlines aren’t visible.

If you could possibly produce the same cfg pack for this resolution that would be amazing.

640x480 is just probably too low-rez for this shader. try an overlay? the wii scanline overlay is for 640x480 i believe.