CRT Scanline shader for SNES Classic Mini?

Ok ill do that for the time being.

Quick question about RetroArchs key combinations, im wanting to set a key config for exiting Retroarch, so when i press L+R+Select+Start it quits back to the SNES Classic menu. I know the button numbers for these buttons in RA is 4+5+8+9 but im not sure how i enter these in the Retroarch.cfg file. Do i need to just add them to the line for Exiting RA with a space between each number as im guessing i cant add a ‘+’ between each number??

If it’s through RetroArch and not the SNES Classic’s menu, you can’t enter arbitrary combos into the cfg, you have to select them from the hardcoded options in settings > input > menu toggle gamepad combo

Thats just for bring up the RA GUI in game though isnt it, is there a combo you can set for actually exiting RA completely?

Yeah, that’s just for the menu. Unless they’re doing something special with the mini builds, the only combos you can use to exit the program are by assigning a ‘hotkey enable’ and then using that button plus something else to exit.

Guess its not a massive hardship of calling up the RA GUI and selecting exit but would of been nice to hide RA altogether

Well I’ve been super busy at work but I figured I should post something.

Once I have time to make everything work better/nicer I’ll make a new thread to put everything in. But for now I’ll just post this in here…

I started to learn how hakchi mods work though. I still have a lot of work to do and the install script is dumb because files weren’t copying properly for me. But here is a test hmod file for hakchi with the shader + a some configs for some cores. Note that there will be issues with sizing and possibly centering right now. It looks like overlay/aspect ratio configs will need to be done on core by core basis (game by game for arcade!). It’s also hard to know exactly what overrides will be needed. So if you’ve been messing with retroarch for some time, then it might be best to nuke the /etc/libretro folder and install the retroarch module from scratch.

But if you start from a stock hakchi and install the 1.0 “retroarch_with_cores” with some cores and then install my hmod by dragging it onto hakchi… or install it by putting my hmod in the user_mods subfolder and then using the “Modules” menu to select “zfast_shaders_test_version”… then you’ll get this out of the box without configuring anything:

which is pretty good for the moment I think. Even though it still needs work for it to be any kind of final. There isn’t even an uninstall script at the moment after all. But this is a start I guess…

The hakchi hmod is here: https://drive.google.com/file/d/0B5_cUiAJwMMvQkMxWUo5b1NLMnc/view?usp=sharing

There are basic versions (not all of them are “correct”) of the core override config files for the following cores in the hmod:

-FB Alpha -FCEUmm -Genesis Plus GX -Mednafen PCE Fast -mGBA -Snes9x

Not that anything is stopping you from configuring everything yourself.

The shader files haven’t changed much. Except for the filenames. but they’re here:https://drive.google.com/file/d/0B5_cUiAJwMMvUmdMdDJOdVJ4WTA/view?usp=sharing if anyone wants just those.

The current versions can’t be used without an overlay without uncommenting the line:

//#define BLACK_OUT_BORDER

in the files. The SNES classic literally can’t afford the few extra instructions when drawing a fullscreen overlay. It’s just too slow! So since the overlay will cover it, I let the garbage stay by default right now.

Now that this is an HMOD, let me know how it messes up your retroarch install. I won’t be able to fix it for you, but I’d still like to know about it :wink:

3 Likes

So for disabling overlay is it better to uncomment //#define BLACK_OUT_BORDER rather than removing the input_overlay line in the cfg files, right? Or maybe do both?

I’m just basically waiting for hakchi and this shader to mature to go and install it, props to you. Basically until hakchi allows to bulk edit game command lines for adding -retroarch, and not needing to go game by game adding it, which is dumb IMO.

Well if you disable the overlay then you’ll uncover part of the image where there will be rendering errors. So you should then uncomment //#define BLACK_OUT_BORDER to fix the bad rendering. So you would do both if you don’t want an overlay: uncomment the border option and disable the overlay.

Really, the shader should always black out the rendering errors but right now it just can’t run fast enough to. In the next version of the shader, I’ll be making changes for better quality but you’ll have to set the shader to integer scaling probably. I still need to do more work on it before it’s ready. I’m just trying to get it to run fast enough with parameters for the options. Right now it’s okay with the parameters hardcoded but slightly too slow with retroarch parameters. The full-screen overlay really cuts into the limited performance we have available.

Nice progress, ill just take the files and use them for the time being until the final version is released

Are you planning on adding a curvature setting in the CRT shader? Your shader works amazingly on Android!

1 Like

Second this. Curvate would be sweet.

Any progress on this shader?

Yes there has been! But I’ve been so busy that I haven’t been able to make it 100% complete and foolproof.

Here’s what I’ve done so far:

  1. Modified the retroarch launcher script to set the shader automatically. So if you have the SNES UI to CRT you get the CRT shader and if you set it to 4:3 you get a sharper version of Inigo Quilez’s texture filtering algorithm. Also your selected background is used for non-gameboy systems.

  2. Fixed some bugs related to the horizontal scaling. It’s much higher quality now.

  3. Set custom options for certain retroarch cores that don’t report their resolutions correctly: picodrive and mednafen pce fast

So it’s pretty good right now for my own uses.

But there are problems:

  1. The modified launcher script is probably not done in the best way. It’s just what worked at the time and I need to update it.

  2. Not all cores are tested. So I can’t tell you if Stella works correctly, for example. And other cores too…

  3. The fact that some cores require custom options means that some (all PAL for certain cores maybe?) games for those cores might be incorrect if they need different settings than the ones I have have set.

  4. There is no way to uninstall it! So if my options break things for you, you would need to ssh or ftp into the system to delete the extra .cfg files.

So it’s really an “At Your Own Risk” kind of a thing right now. If you want to try the newest version then it’s here: https://drive.google.com/file/d/1z7Ze1x8eUQPOuguf8TSUljoBIkKQ-8Vw/view?usp=sharing

You need to:

  1. Drop the hmod in Hakchi’s user mods folder.
  2. Install RetroArch + any cores with hakchi.
  3. Only after you’ve installed retroarch, then you can install this hmod module separately (it must be done this way so that we can insure that my files overwrite the default ones).

If anyone tries it out, let me know how it works!

1 Like

Sorry, I’ve only done this version for the the SNES Classic. It’s not nearly fast enough for curvature. I might look into adding it to my RetroPie version which is nicer than this shader already.

1 Like

Do you have a rough estimate of how much faster the RPi’s GPU is than the SNES Classic’s?

It’s pretty close to being that if a RPI3 can do it at 1080p then the SNES Classic can do it at 720P. Give or take ~3 fps depending on exactly what your code does. And then if you use a fullscreen overlay, then that sucks up enough performance that a 60fps shader on the pi might not be at 720p on the SNES.

The reason this shader basically only works at 3x integer scaling isn’t for speed. It’s because the Mali 400 precision issues prevented me from using a polynomial/Gaussian function for the scanline profile (I’d get artifacts part way through the screen no matter what) and the low resolution forced me to use integer scaling for even looking scanlines.

When I get off work I can test your shader in “Another fast CRT shader” on the SNES Classic and let you know how it does. If that’s why your asking :slight_smile:. My experience with the SNES Classic thus far suggests that something ugly will happen though. Probably the mask won’t render correctly at the very least. But who knows? Your shader does look pretty nice!

heh, yeah, that’s what I was curious about :slight_smile:

And yeah, these mobile GPUs are always a crapshoot. Something that works on one breaks on another… Desktop GPUs are a little better, but not by much.

Here you go. These should be the defaults of ‘fakelottes’ with curvature off. By toggling options, I can tell you that the problems on the bottom section are precision issues in the scanline calculations and the problems on the rightmost section are precision issues in the the mask calculations. And turning off integer scaling so that it renders more pixels drops it from 37.4 to 32.8fps. But some of the masks are faster: option 2.0 runs at 49.9fps.

Also, the Mail 400 shader compiler says your fragment shader runs in 20 clock cycles. For reference mine takes 12cycles and will drop below 60fps with the SNES border overlays if I make it take 13 or 14 cycles. Which is kind of a bummer because I like the shadow mask effect from Lottes shader.

FAKELOTTES on SNES Classic

And just because I haven’t posted any new images of what’s included in my newest upload. This is what you’d get:

lol jesus, fakelottes looks terrible. That precision stuff is a dealbreaker. Thanks for testing, though!

yeesh, 12 cycles is pretty limiting. Yours looks quite nice, nevertheless! Good stuff :slight_smile:

[oh no, I just realized I’m older than Marge :confused: ]

Any update on this SoltanGris42?