CRT Scanline shader for SNES Classic Mini?

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ā€¦

The scanlines looked even with ā€œdonā€™t careā€, as far as I could tell from that video.

There seem to be a band issue every couple of scanlines or so, if you look at the purple buildingā€¦

Also The SNES Classic Mini has a rewind feature implemented kind of like retroarchā€™s im just wonder as this is enable at a system level is this using up extra resources thats cause performance issues with shaders when using Retroarch?

[quote=ā€œBlockABoots, post:22, topic:12664, full:trueā€] There seem to be a band issue every couple of scanlines or so, if you look at the purple buildingā€¦[/quote] The one setting you didnā€™t seem to try was Filter: Linear and Scale: Donā€™t care.

Like crt-pi, this shader needs linear filtering to work properly.

Ok ill give that a try, does integer scaling need to be enabled or disabled?

It doesnā€™t need to be enabled so try with both. Non-integer scaling is obviously better as it fills the screen vertically but it can be difficult to achieve - particularly with simple calculations.

Guess the SNES Classic has 720p in its favour then so running non interger scaling shouldnt be so much of an issue

Ok, Iā€™m glad to see that it runs now!

Now that it is Iā€™ll see what I can do about making it look a bit better at 720p. Thanks for making that video too BlockABoots, itā€™s really helpful. For non-integer scaling, Iā€™ll adjust the scanline profile a little and that will help fix any uneven scalines.

For now: you should have it set to ā€œFilter: Linearā€ and ā€œScale: Donā€™t Careā€ like davej says.

And then under Video, you probably want these settings (for nowā€¦):

Aspect Ratio: Custom

Custom Aspect Ratio Width: Somewhere between 896 and 960

Custom Aspect Ratio Height: whatever number says (3x) next to it. 720,717 or 672 depending on other settings

Integer Scaling: OFF (since weā€™re manually setting integer on the axis we we want)

Custom Aspect Ratio X pos. (Just center the image)

Custom Aspect Ratio Y pos. (Just center the image)

Then back under quick menu, shaders, you can start trying different parameters if you want.

Thanks for the info, ill try them out!

Ok just inputted the suggestions you made but im still getting uneven scanlines, odd thing is it just seems to be the bottom half of the screen the top half seems to be fine

If you look on the pillar of the red building the bottom half has uneven scanlines every other scanline or so yet the top half seems to be fine!..

It looks more prominent on my 42 LCD screen but you get the general idea from that screen shot

EDIT: Also if i change the Aspect ratio Height to 672 then you can see the difference from the bottom half of the screen compared to the topā€¦

1 Like

Have you tried not using a custom aspect ratio and just using regular olā€™ scale-to-fit with core-provided aspect?

Okay I have a few questions for you"

(1) Why are your images 2560x1440? Just because youā€™re viewing a video at your desktop resolution? What was the video captured with? And what resolution was the capture done?

(2) Is your TV 1080p? Because the snes classic outputs 720p only, so the scanlines will get applied to the 720p image and then upscaled to 1080p by your TV no matter what.

So it isnā€™t really possible to have ā€œinteger scalingā€ unless you plug an snes classic into a 4k tv (720 goes into 2160 evenly). And this means that there is probably no way to get perfect scanlines on a 1080p tv even with the integer scaling options of retroarch or writing the shader to only to integer scaling. Weā€™re stuck with some scaling no matter what and that will mess with the scanlines to some extent.

But Iā€™ll set my rpi to output 720p and try to get things as nice as possible this evening. I just spent a while making the shader do integer scaling before realizing that this wonā€™t fix our issues at all because 1080p sets are the target.

1 Like

No i didnt, ill give that a go.

Ok,

1.Yeah by desktop res is 1440p

2.I captured at 720p

3.My TV im viewing on is indeed 1080p.

Bit odd that is only appears to be displaying uneven scanlines on the bottom half of the screen though

Hi, after setting my rpi3 to output 720p I found that itā€™s pretty tough to come up with something that looks good all of the time. So I took a shot at writing a shader that scales the image up to the largest integer that fits in 720P (or whatever the native res is), centers the image there and then applies a more basic scanline effect. The advantage of this is that the 720P output just wonā€™t have uneven scanlines. It canā€™t unless I just messed up. Which is possible because I had a heck of a time actually getting this to work properly.

Unfortunately it isnā€™t faster than the old shader. Which means we need to test the speed again. And good output depends on your TV doing decent scaling to 1080p. And unless the game resolution is a divisor of 720 then youā€™ll get an image that isnā€™t full height. But I think this is the best chance at something that looks generally good.

You can grab the shader and a preset file here:

The preset GLSLP goes in the parent folder and the GLSL goes in the shader subfolder (the normal case for retroarch shadersā€¦).

Let me know if this works and especially if there is weird output (size/position of the game). And what the speed is. Sadly it could be slowā€¦

This is what itā€™s supposed to do:

EDIT: and as soon as I looked at the post I realized that the image wonā€™t be quite centered horizontally because I didnā€™t account for the aspect ratio of the gameā€¦ oh well