CRT Scanline shader for SNES Classic Mini?


#1

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.


#2

Did you try crt hylian sharpness hack?


#3

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


#4

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?


#5

Whats the difference between cg, glsl and glslp?


#6

i have no idea, just differently complied shaders maybe?


#7

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:


#8

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


#9

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


#10

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.


#11

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.


#12

Ok great, ill wait for a fix


#13

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?


#14

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.


#15

Sadly thats still not working


#16

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!


#17

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


#18

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.


#19

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.


#20

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…