Hi guys, first post here. In the past I made a shader for FS-UAE (Amiga emulation), but since i found that retroarch has a pretty good support for whdload games, I ported it to slangp so that it can be used with other emulators too.
I’m not that expert with technical terms, but i’m fortunate enough to own an old 15khz slot mask crt monitor inside an arcade cab loaded with Advance mame and other old emulators, so I used it as a reference. Why using a shader, you may ask, instead of the almost “real thing™”?
Actually that thing is big, heavy and power hungry and since it is running on an old AthlonXP i expect it to break sooner or later and i’ll not have spare time to fix, that’s for sure. Also, i’ve finally got an awesome oled 4k tv and i think that with that amazing (low) pixel persistance and resolution, we can get pretty damn close to the “real thing™”
One of the main goal of this shader is to be usable on integrated GPUs.
Granted, don’t expect it to run on a Raspberry pi, but the actual target is
Intel Haswell, the one on which I develop it, where it perform with all the features
enabled, when dealing with 240p content, on 1080p at resolution ad about 85/90fps.
Actually, it provides emulation for:
- Scanlines
- Screenlines
- RGB phosphors
- RGB deconvergence
- NTSC/PAL CVBS color bleeding
- NTSC color artifacting (early stage)
- Aperture grille and slot mask.
- Input signal glowing
- Output signal glowing
- Blooming
- Gamma, contrast, saturation, luminance, color temperature adjustments
- Black frame insertions through alternate blanking
- Interlace flickering, forcing and emulation
- Antialiasing
- Curvature
- Ambient lights
- Vignette and Spotlight
- Bezel (Thank you HyperspaceMadness for allowing me to rip his automagically generated bezel!) https://github.com/HyperspaceMadness/
- Background images
- Full screen glowing
Version 3.9.01 is up on github and should be available via online updater in Retroarch.
Relevant changes over 3.5:
Bezel:
- Provide a straight bezel as well
- Better reflections blur
- Allow to use ambient lights to colorize the bezel by a custom amount
- Reflection blur can now be customized to depend on the distance from the tube
- Allow to manually set alignment parameters for bezel reflections
- Reflection in the corners can be tweaked via static config, not just in the texture.
- Reflection strength can be freely configured
Bloom:
- Far better look even at higher sizes with no performance cost.
- Bloom may now depend on Zone brightness
- Bloom modulation can be temporally smoothed
- Bloom temporal modulation inertia can be configured
- Bloom modulation can be “soloed” to better tweak it
Other Improvements, changes, additions
- Allow to shift and zoom the whole image.
- Adjusted global noise/deband code
- Moved aspect ratio settings down in the option list
- Add RF noise
- Allow to specify a minimum and maximum scanline height.
- Add optional support for backdrop images for BW games that use mirrors
- Add a clean scanline preset and other “classic_take” presets.
- Use NTSC conversion weights to get average luminance
- Allow to change the default back/over image wrap_mode.
- Luminosity dependant zoom is now temporal smoothed
- Provide a way to selectively blur ntsc artifacts.
Performance:
- Reduced number of total passes
- Performance optimizations in warp function
- split config.inc in config.inc and config.globals.inc to easilly
- Tune parameters to static and gain (a lot of) performance
- Further reduced ambient light gpu use.
- Disable bezel mipmap generation by default, gain performance.
- Bit faster pixel_darklines
- Better glow spread that depends on color brightness
- (optionally it can completely drive blur sharpness)
- glow and halo: use 2 passes (x,y)
Bugs fixed:
- Fix composite bleed + deconvergence togheter
- Get rid of another useless pass for ambilight, gains DX11 compatibility
- Keep bloom size consistent across input resolutions
- Keep bezel reflection size consistent across resolutions
- Avoid negative pow exponents (fixes koko-aio under nvidia and probably amd)
- Bezel reflections now are consistent with luminosity dependant zoom
- Workaround graphical glitches when switching “temporal” options runtime.
monitor-slotmask-bloom-bezelwider - Arcade - Final fight
monitor-Commodore_1084S-wider - Amiga - ProjectX SE
tv-PAL-my-old - Master System - Trans Bot
tv-NTSC-1 - Genesis - Sonic 2
tv-NTSC-2 - Snes - Aladdin
tv-aperturegrille-bloom-bezel - Amiga - Leander
Even if I’ve had to look to multiple shaders to understand how glsl first and slang works, I re-used and modified blur(bloom) code from CRT - Guest - Dr.Venom (single pass bloom function) and completely included without modifications Nvidia’s FXAA for antialiasing into its own pass.
- Main development done on this Github repo
- GLcore or Vulkan are probably required.
- Stable releases should be available through Retroarch’s online updater
(shaders_slang/bezel/koko-aio/) or here. - Click here if you want to try the latest in-develompent shader and unpack the zip somewhere inside your -already in place- shader directory.
I do not ensure you it will work as expected nor that your cat will be safe. - Make sure to read the docs!
- A new repo is up: koko-aio-slang-presets-and-overlays
to contain external submissions of new presets and overlays. - If you want to boost your fps and you don’t mind tinkering with text files, take a look to the file config.globals.inc in the shader folder and follow the instructions; on intel IGPs, I’ve seen fps boosted by 45%.
Please, tell me what you think, any comment is really appreciated.