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:

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:

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:

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…