CRT Scanline shader for SNES Classic Mini?

Seeings as the SNES classic mini has now been hack (just like the Nes mini) and there is a build of Retroarch for it i was wondering if anyone could create a shader that is able to run on the system.

I have tired the usual lightweight shaders (crt-pi, crt-easymode, crt-geom, crt-cgwg-fast) but they all effect the performance of the snen classic mini.

1 Like

Did you try crt hylian sharpness hack?

If even crt-pi is too slow, youā€™re probably stuck with simple scanlines and overlays.

The SNES Mini only seems to work with glsl type shaders, cg or glslp types dont have an effect at all. Is there just a bog standard scanline shader for glsl?, also i dont think there is a hylian sharpness hack shader in glsl format?

Whats the difference between cg, glsl and glslp?

i have no idea, just differently complied shaders maybe?

How slow is crt-pi? Does someone know what kind of fps weā€™re looking at? 55? 20?

Because I couldnā€™t get 60fps out of crt-pi at either 1600x1200 or full-screen 1920x1080 (1440x1080 is fine ā€“ and what crt-pi was intended to do)

So I wrote my own shader with 60fps at full-screen 1920x1080 as a target (really 1600x1200 but I used 1920x1080 for testing). There are some changes that should be made for use at 720p. And there are still a couple of things that I could do to make it a little faster. But right now, it runs at around 10-15% faster than crt-pi. And like I said, it could still be made slightly faster.

You can grab the early version here: https://retropie.org.uk/forum/topic/13356/new-crt-lcd-shaders-for-rpi3-they-run-at-60fps-at-higher-resolutions-and-are-configurable

But Iā€™m going to make some changes and try to make a 720p focused extra fast version in the next day or two. But donā€™t expect miracles. If itā€™s not pretty close to fullspeed now on the SNES Classic, then it probably wonā€™t get thereā€¦

Current screen for those interested:

1 Like

Oh nice, if you could do a 720p version for the SNES Mini and i can test it out for you and report back how well it works and if its all good and 100% speed then you could name that version SNES MIni or the like

Just tried loading the 3 glsl shaders on the SNES mini and for what ever reason none of them apply any effects when i try and enable them

Cg shaders require Nvidiaā€™s Cg Framework, which is not available for ARM. It was our main multiplatform shader format until Nvidia deprecated the whole language a couple of years ago.

*.glsl files are the shaders that work most places, including S/NES Classic/Mini. *.glslp files are plaintext files (i.e., no real code in them) that function as ā€œpresetsā€ to mix the effects of multiple GLSL shaders and/or apply settings/metadata to individual GLSL shaders.

Well alright then. That probably means that the shader compiler in the Mali driver doesnā€™t like something Iā€™ve done in the shader. That will be an easy fix if I can figure out what specifically it doesnā€™t like. I donā€™t have a SNES classic, but intelā€™s driver is picky too, so Iā€™ll see what it says. Anyway, thatā€™s another thing Iā€™ll be looking at today/tomorrow.

Ok great, ill wait for a fix

I havenā€™t made an attempt to make it faster or prettier at 720p yet. But does this run for you on the SNES Classic? If not, Iā€™ll keep looking for the problem. The issue is almost certainly the COMPAT_PRECISION, COMPAT_VARYING, COMPAT_TEXTURE stuff thatā€™s bolted on and nothing to do with the actual shader code. Iā€™ll get it fixed after a couple more tries for sure :slight_smile:

https://drive.google.com/file/d/0B5_cUiAJwMMvVmdSVFB0dFYtemM/view?usp=sharing

But if it does run, can you get to the Video menu in retroarch and check the FPS?

If youā€™re not already working from it, the slang shader conversion template is a good place to start working on GLSL shaders, IMO. It has all of the compatibility macros taken care of and some helpful comments, too.

Sadly thats still not working

Thanks, Iā€™ll grab that. I found the Mali offline shader compiler too, which makes it easier to check if the shader compiles there once Iā€™m doing things correctly and also counts instructions, which will be helpful once I find out just how slow the shader is on the snes classic. How did Nintendo manage to find something slower than a rpi3 though, thatā€™s what I want to know!

1 Like

lol ikr? Itā€™s shocking to me that you can even get anything that slow these days.

Sorry about that. The script that hunterk pointed me to should take care of the missing compatibility stuff. And then Iā€™ll double check that it compiles on the Mali driver, and then Iā€™ll upload something. It will probably be a couple of hours though.

Ok. I went over the shader conversion template from hunterk. Then I checked that the Mali driver compiles it with no errors (it does). If the shader still doesnā€™t run on the snes classic, I can try taking out the last option that is still set as a #define. If that doesnā€™t work either, then Iā€™ll be out of ideas for the moment since the shader works fine with nvidia graphics on win10, intel graphics on linux, and on a rpi3.

I also changed most options to retroarch parameters, so if the shader works, you should be able to set most options from retroarch. So let me know!

Here it is: https://drive.google.com/open?id=0B5_cUiAJwMMvSVBUT0gxMzVSamM

Like the last test, this is just the glsl file. Not the preset, so you canā€™t load the shader with the ā€œLoad Shader Presetā€ option. Only by setting ā€œShader #0ā€ to the shader file.

Ok the shader is now working :grinning:.

But changing the scaling to anything higher than x2 causes massive frame drops, having x5 is like 17fps and x4 24fps and obliviously leaving it on ā€˜dont careā€™ results in uneven scanlines.

Heres a video i postedā€¦