Version NG-1.9.13 is up on github and should be available via online updater in Retroarch.
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.
Click to read features
- Scanlines
- Screenlines
- RGB phosphors
- RGB deconvergence
- NTSC/PAL CVBS color bleeding
- Aperture grille, slot mask, shadomask.
- 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
- 3D rotation/tilt
- Integer scaling
- Background image Night mode
- Support for backdrop images for BW game/CABs that use mirrors
- NTSC emulation with selective artifacts smoothing
- Temporal bloom
- RF Noise
- Dot matrix display emulation with grid, shadow and motion blur (gameboy mono)
- Monochrome display “colorization”
- TATE mode
Click to read relevant changes over 4.1 and previous NG releases
Main changes from NG-1.9.1
Presets
- less bloomy tv-pal-myold preset
- 2nd take on tv-flickering preset
- Sharper tight halo
- Better slotmask-taller preset
- Lowered spot strength in presets
New Features
- Add an Adaptive black level function (deeped blacks on brighter content)
- Allow to specify the ambientlight sampling point
Performance
- Several Micro-optimizations (moderate speedup: 2%…3% on my Haswell)
- Working again on d3d (Xbox) via #define D3D_WORKAROUND
- Drastically improved compilation times and ntsc color bleed performance on Xbox Series S
Fixes
- Allow to configure dynamic zoom (raster bloom) again (regression fix).
- Do not nightify bezel when not using bg image
- Fix black lines on the sides when using dot matrix shadow function
- Slightly offset x coords too to avoid geometry glitches
- Avglum functions needs to activate when resolution switch glitch is needed
Main changes from NG-1.4
Presets
- New Monitor-FXAA_sharp-Screen_SlotMask.slangp
- New Monitor-New_aperturegrille_gm.slangp
- New Monitor-VGA-DoubleScan.slangp
- New Monitor-Screen_Hmask-ShadowMask.slangp
- New Monitor-Screen_Hmask-Screen_SlotMask_Taller.slangp
- Halved spot power
- Set almost all presets temperatures to 7200K
- Switch to “fake” integer scanline instead of faker on interlaced content by default
- Hard cut artifacts under treshold on NTSC-2 preset
- Set Automatic integer scanline switching on by default
New/Removed Features
- Dedithering
- Phosphor persistence
- Added lcd antighosting static feature
- Permit integer over-scale
- Removed tilt along y axis, no performance increase, but one param less.
- Removed alternate blanking feature (was already made static)
- Improved NTSC emulation for “anything but rainbows”
- Allow optional Double-scan low input resolutions
- Fake integer scanlines: use -1 to let the shader choose when to activate them.
- Shadowmask
- Add a vibrance parameter to compress chroma dynamic range
- Shake the screen for a while when the resolution changes
Fixes
- Corrected fake integer scanlines period
- Add a new workaround for D3D/XBOX
- Fix a possible division by 0.0
- Cut shader compile time from minutes to seconds on XBOX
- Back/Foreground image rotation/mirroring: support all possible permutations
- Make fake integer scanlines work with rotated and/or tated games too
- Integer scaling now works with tate mode on rotated games
- Bloom: identifying bright areas was broken when overriding content geometry
Changes
- Denoise vignette again
- NTSC color bleed is controlled by just 1 parameter now
- Improved dedot function
- Allow to turn on flickering even when not emulating masks or scanlines
- Split spot position parameter in two, (X,Y)
- Don’t draw ambientlight over the content when using foreground image
- Foreground image, do not “void” transparent areas which are not on top of the game content
Performance
- Overral unchanged
- Removed some dead code that unexpectedly used to slowdown execution
- Slightly faster basal grid computation
- CVBS bleed: 2…4% speedup by joining side loops
Main changes from NG-1.0
Misc
- Xbox/d3d compatibility: add specific workarounds, enable them by editing config/config-static.inc
- New config/config-static.inc and config/config-user.txt files. Use them to change static parameters or tu turn runtime parameters into static ones and gain performance. Keep a backup before updating, ofc.
Presets
- Mitigate glitch patterns in Generic-Handheld-RGB.slangp
- Add two handhelds dotmatrix presets “dots” in uncorrected aspect and 4:3 aspect
- Wider ambientlight in generic handhelds rgb preset
- Tweaked ambientlight on gba night preset
- GBA preset: Switched from dotmatrix to pixelgrid
- Reduce spot power on immersive preset
- Add a simple immersive fxaa preset in the old 4.1 folder
- Updated overmask presets to include unsharp-mask+FXAA and moire mitigation
- New preset Monitor-Screen_Hmask_WideR-Screen_SlotMask
Parameters
- Removed GEOM_CUT_EARS parameter, useless since using my curvature now
- Add moire mitigation option
- Allow to define ambientlight wideness for rotated games
- Allow to switch to fake integer scanlines, always or only on interlaced screens (see docs)
- Haloing can happen on an already “scanlined” image if a new static parameter: HALO_PRE_SCANLINE_GAP
- Remove Inter-cell extra steepness parameter; it has been never used and has very little effect
- Vertical cell Mask->Vertical shift: negative values will select the sharpest line when using screen coords
Fixes/Changes
- Bloom strength on white area was broken when using content geometry override, fixed
- Mitigate clipping on bright background images when mixing ambilight over them
- Disable ambientlight debanding grain/noise when using a background image
- Recentered wx mask so that phosphor falls at the center
- Fixed textures paths in handhelds presets
- Give halo a slight (very slight) rounder look
- Slightly optimized pixel_blank_alternate (still statically disabled)
- Dedot: use green as main channel
- Move DYNZOOM_FACTOR in the static config file
- Switch TATE mode to Auto by default, should affect all the presets
Performance
- Modified debanding code, should be a bit faster now
- Found a bottleneck in the vignette/spot code; small speedup
- Since we gained some fps, switch HALVE_BORDER_UPDATE to 0.0 by default
- small optimization to ntscdec()
Main changes from 4.1
-
Low level phosphor-grid which superseedes scanlines, vertical and horizontal mask. provides more features and is much more flexible by allowing to emulate common masks and freely draft new ones.
-
Add a new overmask preset to increase the whole visible mask (at the price of moire patterns on lower resolution).
-
Add a new Spark look punch to increase the vertical mask effect.
-
Allow to vertically stagger single phosphors to better emulate y-deconvercence.
-
Allow to change vertical and horizontal mask gamma.
-
Spot is now painted over the whole tube when using bezels and not just on the game content.
-
Improved reflection look.
-
Workaround for Flycast + Nvidia + Glcore + Ambient light not playing well (that was tough).
-
Ambient light scene changes are not instantaneous.
-
Selective NTSC artifacts blurring: inverted logic/workflow.
-
Switched to my own curvature function.
-
Luminosity tied zoom now has an hardcoded range.
-
Add an option to show “basal” unexcited phosphors grid.
-
Allow to use negative blurring parameters to switch from gaussian to box + (eventually) unsharp mask.
-
Input gain is not tied to glow feature anymore, moved to color correction section.
-
Prevent bloom from color shifting high tones due to color temperature.
-
Allow to pre-attenuate gain levels before applying halo. That way it does not change whan changing gain and may help in avoiding cascading effects when drafting presets.
-
Overhauled nightify function.
-
Allow to widen the ambient light effect without pushing led power
-
Allow to set virtual led position.
-
New ambient light “immersive” preset.
-
Now ambient light bezel and/or background image colorization can use two blend modes, multiply and add (see foggy parametter)
-
New active (not used because prone to change) parameter to clear dot masks betweeb scanlines (dedot).
-
Ambient light does not depend on color/brightness corrections anymore, set it (once) and forget.
-
Debanding is now applied on green component only.
-
Ported all old preset to new code.
-
Made new presets to show different masks possibilities.
-
Experimental delta render to save on battery powered devices which only render zones of the screen that has been changed Statically disabled.
-
Allow to set minimum lines to detect interlaced content by runtime parameter.
-
Add overlay-powered handhelds presets for: Gamegear,Gameboy Advance, Gameboy mono and Gameboy mono pocket.
-
More colorful Ambient lights.
-
Dot Matrix strength has now an “auto” parameter that adapt the grid steepness to the viewport size to mitigate glitches.
Useful links
- Make sure to read the docs!
- Main development done on this Github repo
- 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. - Texture “source” projects for main monitor frame/bezel and other misc files has been moved to another repo to lower the download size.
- More presets and additional artworks: koko repo || estefan3112 repo || Starman99x repo
- If you want to boost your fps and you don’t mind tinkering with text files, take a look to the file config-user.txt 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.
Dynamic room lights (immersive preset)
Hires content
Overmasked
Antialiased
Mask experiments
Handhelds
Ntsc selective blurring and sharpening
monitor-Commodore_1084S-Night
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
gameboy_mono_colorized.slangp - Gameboy mono - Super Mario Land