CRT shader for Steam Deck (and possibly low res display)

Hi Tromzy, as said in the starting post, sadly I can’t give you any tipps or recommendations beside the ones listed above because the whole shader topic is a great mystery to me. I didn’t even bother tinkering with it further after finding the settings to my liking and just play my games because I’m satisfied with the look. The files I provide are basically the result of messing around with the parameters and comparing to other shaders I personally like. The whole purpose was to give other people, especially people like me, who own a Steam Deck and / or play with smaller resolutions a “to go” configuration with the possibility to develop it further for those who have more knowledge about this stuff. Sorry :confused: . I suggest you ask around in for example Guest’s topic. I am sure, people around there can give you qualified answers and hints and help you out.

Hello! New forum user here.

I recently got a Steam Deck and I used Emudeck to install Retroarch.

I really like how 8 and 16 bit console games look while using the 2xBRZ shader (shaders_slang/xbrz/2xbrz-linear.slangp), but I have noticed it doesn’t have any effect on DS games when using the melonDS core.

Is there a way to apply 2xBRZ or a similar effect to 2D screen elements in DS games?

Thanks in advance!

1 Like

If you’re increasing the internal resolution, it will break any shaders that use pixel pattern detection algorithms, such as hqx or xbr. However, there is a set of super-*xbr-3d shaders that will compensate for the internal res boost (pick the preset that matches your scale factor) and skip the up-rezzed polygons while smoothing the pixelated HUDs and menus, etc.

1 Like

Thank you very much for the information, @hunterk! The internal resolution upscaling was definitely messing with the shaders.

Once I changed the internal resolution to 1x (native), I saw some pretty good results using the super-8xbr-3d-6p.slangp shader. However, there was a big FPS dip, from 60 to around 45, so the emulation got choppy. That was despite the GPU and CPU utilization were nowhere close to 100%.

I then disabled the OpenGL renderer in melonDS so it switched to Vulkan. The GPU utilization went way down, but now the image while using super-8xbr-3d-6p.slangp had a lot of artifacts. I had better results with the super-2xbr-3d-2p.slangp shader: great image quality while keeping the emulation going smoothly.

While the polygons look sharper when using the OpenGL internal resolution upscaling, I’d rather have the improved 2D text and backgrounds. So far I have not been able to find a combination to “have it all”, despite testing with every shader preset in the shaders_slang/xbr folder. The shaders in the xbrz folder didn’t have any effect.

I have attached a couple of screenshots, one with no shaders applied and another one using super-2xbr-3d-2p.slangp. Both were captured at the Steam Deck native resolution (1280x800).

No shaders

super-2xbr-3d-2p.slangp

3 Likes

ah, yes, the hybrid layout causes issues, too, since it’s doing scaling there, as well.

In the ‘handheld’ directory, I have some called “ds-hybrid-view-…” for sabr and scalefx. Those will take the normal over/under image layout, do a hybrid view layout beside and scale the big image with the selected scaler. I, personally, think it’s the best way to handle this.

4 Likes

That’s a neat idea! And the new sxbr looks surprisingly good on DS games, though you have to choose both screens to appear at the same size (left/right). To work on hybrid layout I had to develop a new version specifically for that.

super-xbr (latest on repo, run in linear gamma):

And a ddt-jinc shader I’m working (gamma not corrected):

5 Likes

I went ahead and edited those hybrid presets from @hunterk and added the new xbr and super-xbr to work like that, get here:

xbr and sxbr hybrid presets.zip

To use it you need to:

  • unzip these presets inside “handheld” folder;
  • update your slang shaders to latest using update online inside retroarch;
  • Use 16:9 aspect ratio and integer scale OFF;
  • In DS CORE option choose TOP/BOTTOM layout.

Now you can load any of these presets and get this:

OBS: I’d like to know if they run fullspeed on steam deck, as I don’t have one.

EDIT2: Added the two 3D old xbr and super-xbr too (now called hd versions). They work with CORE at 2x Internal Res, so the 3D games look better (though the 2D uses old code, so the new ones are better):

I still have to rework these old “3d” versions to use new xbr and sxbr code.

7 Likes

Thanks a lot for all your help, @Hyllian!

I installed the files and followed your procedure. The graphics look good! Using Vulkan, the CPU and GPU utilization stay below 25%. The emulation runs smoothly.

There is a problem though, probably specific to the Steam Deck: when you modify the screen layout using the ds-hybrid-* shaders, the touchscreen does not work properly, as the touch zones do not match the DS screens anymore. While it wouldn’t be a big deal if you’re playing mostly on a TV, it kind of breaks using touch for handheld gaming.

When you use the melonDS built-in hybrid mode, the touch zones work properly.

1 Like

ah, yeah, this is a known thing. If you use a mouse or the analog sticks to emulate the pointer, it will still work, since you can watch the crosshairs move, but touch uses absolute coordinates that are not tracked in the shader redirection.

2 Likes

Hi @pickless83,

sorry for the late reply. Yeah, that one I had to understand myself in the beginning. Emudeck does install Retroarch from the Discovery Store, so it’s a flatpak. The mounted directory on the Steam Deck, where flatpaks are installed, is called “var” and is read only per default for the deck user, like the root directory. You could disable that, but i don’t recommend it so it’s fine.

Under your home directory, the place where you have full access and where games etc. are installed, you can find more directories and files from your flatpaks. There are in ~/.var/lib/app/. Make sure you can see hidden files in Dolphin. There, you’ll find a Retroarch directory and subdirectories for different stuff like configs and shaders. Just copy all the content in the shader directory from the read only directory into the Retroarch shader directory in your home directory. Next step is to place the shaders you like into that same directory. Then, you have to change the directory path in Retroarch for shaders to the shader directory in your home directory. That will make sure that you see als those shaders in the Quick Menu and, when updating shaders in Retroarch, they get downloaded to your home directory and you don’t need to copy them over again.

Hope I did describe it well :smiley:

4 Likes

Hi,

a little update.

RetroArch is shipping with new shaders and the new ones from Guest Advanced are also part of it by default. Therefore, I updated and simplifed my presets. They are now using the shaders coming with RetroArch as a base. This makes things easier. As a bonus, I provide a list of updated shaders at the end, that look fantastic on the Steam Deck out of the box for retro handheld systems.

ps. I’d like to restructure my first post but couldn’t figure out how edit (any help?), so I’ll post the stuff here for now.


Let’s get started with some screenshots for comparison:

Sega Mega Drive / Genesis

Super Nintendo

Nintendo 64

Playstation

Sega Dreamcast

I must say, screenshots don’t do justice, especially due to the low resolution. The mask might look odd in some examples and the overall look in 3D games is darker than actually in game, for whatever reason. Brightness can be tweaked within the shader parameters if it is actually too dark for you. Just give the presets a try and see for yourself how it looks. Bezels are not part of the presets. I’m using the ones from Duimon.


USAGE:

Important - Update your shaders in RetroArch so you have the current version - Important

>>>>>> Download shader presets <<<<<<

  • Deactivate any kind of video / display enhancement, e.g. NTSC filter etc., in the core options or it will mess things up. The shader does provide everything you need.
  • The presets give you an aperture grill rgb Trinitron look. If you want something different and more prominent scanlines, change the mask type from 6 to 5 or 0 within the shader parameters.

The presets do reference the original shader in its respective directory and only include tweaked parameters. They should be placed in the shaders directory, just above the shaders_slang directory. If you want to place them elsewhere , make sure you change the path in the preset file. There are 2 presets in total.

- schM0ggi_steam-deck_guest-ntsc

This is for Super Nintendo, Sega Megadrive, Nintendo 64 and Playstation.

- schM0ggi_steam-deck_hires_guest-ntsc

This is for Sega Dreamcast and other cases where a higher resolution is being used.

Why the split? Well, games on Dreamcast run with a higher native resolution (640 x 480) compared to the other systems, therefore additional tweaks are needed. Though, bear in mind that some Nintendo 64 games offer high resolution modes - Turok 3 being one example - which, if used, might also need the “hires” shader preset. This is unfortunately a case by case basis as high resolution modes in Nintendo 64 don’t use the same resolution. It depends on the game. Again, Turok 3 is one of these examples.

IMPORTANT NOTICE:

As some systems (Sega Megadrive for example) have special characteristics, like transparency effects, there are (for easy usage) 2 parameters of interest you can tweak to change the overall look. These are:

- NTSC Merge Fields

Personally, I like 1. Set it to 0 for some flickering and rainbow effect.

- NTSC Phase

Personally, I use 2 and 4, depending on the system. 2 gives you a composite blurry picture. 3 resembles a more sharper RGB look and 4, to my observation, combines both (good transparency and color/sharpness).

Here is a comparison of Sonic and the famous waterfall with different settings. The flickering, that comes with NTSC Merge Fields set to 0, is obviously only visible in real gameplay:

NTSC Merge Fields = 0 | NTSC Phase = 2

NTSC Merge Fields = 0 | NTSC Phase = 3

NTSC Merge Fields = 0 | NTSC Phase = 4

NTSC Merge Fields = 1 | NTSC Phase = 2

NTSC Merge Fields = 1 | NTSC Phase = 3

NTSC Merge Fields = 1 | NTSC Phase = 4

CLOSING WORDS:

For Gen 5 consoles, I previously used Guest Advanced 3D. This shader does also work fine after some tuning. So, if you don’t like the 16 bit NTSC look for 3D games, give this shader a try.

SHADERS FOR HANDHELD SYSTEMS (BONUS):

As mentioned, here are the shaders for handheld systems that also come with RetroArch and work out of the box for the Steam Deck. They do look fantastic:

- dmg.slangp

For Gameboy under shaders_slang/handheld/console-border/

Deactivate colorizing option and ghosting effect. Shader does provied everything you need. Set aspect ratio in your video settings to Full. You can scale the image and overlay withing the shsader parameters.

- gbc-lcd-grid-v2.slangp

For Gameboy Color and Advance under shaders_slang/handheld/console-border/

Deactivate color correction option and ghosting effect. Shader does provied everything you need. Set aspect ratio in your video settings to Full. You can scale the image and overlay withing the shader parameters.

- lcd1x.slangp

For Nintendo DS under shaders_slang/handheld/


Happy retro gaming!

9 Likes

Hiya, Just checking in. It’s a shame Emudeck hasn’t put in your CRT shaders as a default yet, considering their own crteasymode doesn’t actually do anything on Steam Deck when it comes to reproducing CRT effects on games like Sonic and Earthworm Jim, among many many others. Kind of defeats the entire purpose, and potentially misleads users into thinking they’re seeing games as they were originally intended.

Anyways @schM0ggi do you have any plans to create / tune CRT shaders for ReShade for Steam Deck? I’m wanting to use CRT shaders on games outside of Retroarch, but having trouble finding good sources for shaders that will work well with the Deck’s resolution.

Also here’s some more notable parameters in case it helps anyone.

[SCREEN OPTIONS]

  • CurvatureX and CurvatureY handle the fake screen curve. Set these values to 0 if you want a totally flat quadrilateral image. I turn it off or leave it on depending on the game.

[COLOR TWEAKS]

  • NTSC Phase - This was already mentioned, but it worth noting that the sharpness of 3 Phase can degrade the CRT effect on some textures, and may require tweaking some other settings if you want to keep the effect.
  • NTSC Resolution Scaling - This is the big one, in that it is the primary thing that directly affects whether you get CRT effects on dithered textures or things like Sonic’s Waterfall. If you turn it up too high you’ll notice the image becomes clear enough to where the magic is gone. Alternatively, if you turn it too low the image becomes a vaseline slathered blurry mess.
  • NTSC Bleeding 2 Phase / 3 Phase - This is also important to the CRT look. It determines how much colors bleed into one another. If Schm0ggi’s presets are too bleed heavy for you, try adjusting this. Note that 2 Phase and 3 Phase values are separate. They correspond to the NTSC phase setting. Changing the value of the 3 Phase bleed will do nothing if you have the phase set to 2, and vice versa. Unless you have it set to mixed.

On a side note, there’s nothing stopping you from using these CRT shaders with handheld games like on the GBA. Even though those games weren’t intended to be viewed on a CRT display, if they have dithering… you’re gonna see some magic happen. Some examples of CRT conducive GBA games include DKC3, Sonic Advance 3, and Mario Tennis Power Tour. Basically anything that has a lot of dithering or is using pre-rendered 3D models. DKC3 is notable here as it is a port of a SNES game which was meant for CRT.

However for handhelds you’ll probably need to bump up NTSC Resolution Scaling a little and tone down Bleeding a little to get those games looking right, as GBA resolution is a bit different from consoles.

1 Like

You can also achieve some similar looks using Blargg Video Filter Presets which are included in the options of some Cores and also in the Settings–>Video–>Filters Menu.

Some of the Filters presets were created by me, in case you wanted to try some CyberLab on the SteamDeck.

They begin with “Blargg_NTSC_SNES_Custom_pseudo_xxxx…”.

There are even more updated video filter presets available in my CyberLab Custom Blargg NTSC Video Filter Presets pack available at my preset packs thread.

2 Likes

Thanks for your additional hints regarding some settings. Yeah, the curve effect is actually in my preset if I recall correctly and its called something like warpX/Y. So it’s easily edible there, as well as all the other parameters. I might check out your other mentioned parameters, as I didn’t pay much attention to them, I think(?), and see if I can make it look even better for my personal taste, though I am pretty satisfied with the results so far on the systems I play.

Anyways @schM0ggi do you have any plans to create / tune CRT shaders for ReShade for Steam Deck? I’m wanting to use CRT shaders on games outside of Retroarch, but having trouble finding good sources for shaders that will work well with the Deck’s resolution.

I do not have any plans as I do not have any noteworthy skill regarding developing shaders or general knowledge about them. I just played around a lot with some parameters and observed how they change the overall appearance on screen. Of course, many explanations in Guest thread and on the internet about (CRT) shaders also helped. Sorry. :sweat_smile: I’d love if some skilled people would take my preset or create something new (I don’t care) and improve it as much as possible for Steam Deck and similar devices with a low res.

But thanks for asking and also thanks for the compliment regarding including it in EmuDeck. Haha, I feel flattered, but I really didn’t do much besides changing some parameters. All the work is done by Guest.

3 Likes

If I knew how to take your parameters and implement them into a ReShade shader exactly as is I would do that, but I don’t know how, nor do I know how to port shaders over. I know Guest’s shaders are already ported over so maybe it would be possible, but I’d have to learn how ReShade works and how to toy with the parameters there. I’m very happy with how your presets work out of the box for 240p and 480p games so I don’t mess with them too much. It’s when it comes to GBA stuff I start messing with the parameters a bit more, mostly just bumping up the resolution, toning down the bleeding, and removing curve.

I would really like to see someone try and recreate your presets in ReShade. I found this looking online: https://www.destructoid.com/theres-a-fancy-crt-style-overlay-bundle-available-for-your-steam-deck/

But from my testing these shaders don’t actually reproduce CRT effects on 480p content, at least from what I’ve seen in my testing in RetroArch against your hires preset.

A tip for Dreamcast would be to rather use the core options of Flycast to change resolution to 1024x768, use integer scaling, and then use the internal resolution option of Guest’s shaders to have scanlines (if you want to.). That way the odd misaligment you can see in the shots to varying degree will be minimized. I would imagine that on the Steamdeck’s small screen it’s not particulary noticible, but once you blow that up…

Hmm, maybe these might be of interest for you:

(Don’t know the state of it)

(Has, from my understanding, Retroarch shaders. Only Windows sadly, but it’s worth a try to check if it does run with Proton/Wine, if you are on Linux as well. I might give this one a shot too and see if it works)

And you mentioning a port of Guest shaders to Reshade made me dig a bit and it’s true, it appears Guest shaders are being ported to Reshade.

I don’t have much knowledge about it, like said, but if ported shaders come with the same parameters like in Retroarch, shouldn’t it be a simple task to just find and adjust these specific parameters in the Reshade Guest shader, that are being targeted in my preset for Retroarch?

Yeah, these odd misalignment’s are really strange as they only appear on screenshots, at least on the ones I made. Don’t ask me why, perhaps creating screenshots on Steam Deck messed them up (compression or whatever).

I prefer to play with the original resolutions for an authentic look, that’s why I don’t like giving the resolution a boost (N64 and PSX being an exception, thanks to upscaling and downsampling features in their respective cores which let the games look even better and kind of accurate at the same time).

In any case, I can say with certainty, as long as my eyes are not playing games with me, that these misalignment’s, and the too dark look btw, are not present on a real (Steam Deck) screen. Additionally, though not mentioned, I actually tested my presets on my 1080p screen and it looks, without any further adjustments, fine there, too. So that’s a bonus. :relaxed: I can imagine on higher res like WQHD or even 4K it will look bad but that’s okay because It’s not made for that. :slightly_smiling_face:

Downsampling was something I was gonna mention but forgot. I use it too for some games. Shiren 2, an N64 game I play I run at 2x res and 1/2 downsampling and it looks great with your non-hires preset.

Just a reminder to anyone that if you’re viewing 240p content, use the regular schM0ggi preset. If you’re playing on a core that has upscaling, such as N64 or PS1 and you want to play at 2x resolution, use the hi-res preset like I do with Spyro games. If you’re using downsampling, use the regular schM0ggi preset, as you’re taking the 2x or higher resolution and downsampling it back down to a 1x resolution essentially. May seem obvious to many but I’m just saying it for the sake of people very unfamiliar with these settings and how they interact with the shader.

1 Like