If you don’t want to wait for the Version 8 version to become available in the RetroArch downloader, you can get the packages here:
As an aside to the HDR stuff, i have also noticed that my 2080’s fans go nuts and i drop frames down to about 80 fps when using your shader, unless i enable the shader’s “Bypass Glow” Debug setting, at which point it chills and i get the full 120 fps.
Not sure if that glow effect is just that heavy, if it’s surfacing some normally hidden issue with my specific GPU, or what, but i thought you might want to be aware.
Yeah that’s largely because mipmapping is broken on D3D12 so I can’t use it. It’s a heavy function applied to the entire output resolution.
This is a good time to discuss the MASK_DIFFUSION parameter.
MASK_DIFFUSION
The diffusion of the mask dots is an important part of maintaining SDR viewing brightness and eliminating moiré patterns without needing to rely on subpixel effects. The baseline view is for an SDR, 4K monitor which is probably the most common display type in use today. The diffusion parameter is most accurate in the range under 1.0 down to 0.5, depending on the ratio of phosphor dot to full mask.
The lower bound of usable diffusion is limited by two artifacts: aliasing (moiré) and gain. Aliasing is reduced with higher resolution, and gain can be increased with a higher dynamic range.
The average gain of both beam scanning and masking is calculated and used as makeup gain. In SDR mode, tone-mapping is used to bring levels down to acceptable SDR range. Even in SDR, tone-mapping can acceptably maintain brightness down to a diffusion value of at least 1.0.
The more relevant bottleneck to lowering diffusion right now is resolution. The default diffusion value of 2.0 was selected because it eliminates moiré at TVLs from 300 to 800 for 4K. The diffusion value can be lowered, but moirés can start to become apparent. These patterns are most apparent in a full white field.
Now that I have a better understanding, HDR will be fixed in the next update. There will be additional HDR enhancements in the upcoming weeks as I get more time to test it.
Version 9 will be available in RetroArch shortly, and you can get it here:
In addition to the HDR fixes, the glow effect is much better optimized and my laptop with Intel Iris Xe integrated graphics can run the RF presets at full speed at 1080p. If you use the Vulkan driver, you can enable mipmapping in the parameter menu which can further improve performance.
The next update will have further bezel improvements: better performance and looks better too I think.
A new update will come tomorrow. There are further bezel optimizations, some bug fixes, and I have changed the default CAT to be linear Bradford because this is less harsh on blues (most visible in SDR). I also added an IPT alternative to gamut compression (instead of Luv). It’s actually less accurate, but keeps blue ‘blue’ instead of becoming purple on compression. It’s not the default because I think Luv still looks better, but I added it as an alternative for people who really don’t like blues skewing purple. Gamut compression only happens for SDR.
The bezel reflection color processing is also better aligned between SDR and HDR. They can’t look perfectly identical, but they should look closer to each other. Both use a unified color temperature shift, and for color compression (desaturation mimicking scattering of light), SDR uses Luv and HDR uses ICtCp. I was also doing the color processing per-sample before which was eating performance unnecessarily. The color processing now happens per-pixel.
Blue-noise dithering has been added to the final pass (16- to 10- or 8-bit). All noise generation functions in any shader will now make use of subframes if available as well.
These shaders do seem really cool, but can we not get a set of the Consumer presets without Bezels/Rounded/Pre-applied scaling??
eg. “Flat Bezeless” ?
Sort of. You can look at the hdtv presets and these are very close to flat, with a thin bezel. If you enable the bezel bypass, you can then adjust h-size and v-size to adjust the screen to your liking.
Because of the way the framing system works, you still need to use full aspect ratio instead of core-provided. This is to ensure the mask itself has the correct aspect ratio (e.g. 4:3).
Truly flat requires setting the deflection angle and curvature angles to 0.
Version 10 has a number of optimizations and includes presets optimized for Steam Deck. These can also be useful for low res devices.
Here is a first stab at making specialized Famicom presets.
The SFC presets can be used for the Famicom and you get this (using Mesen’s ‘composite direct’ palette):
Using the raw palette, and reconstructing the original dot pattern waveform results in this. I also added the differential phase distortion and some very light filtering.
The result is hot, but I don’t think the reported IRE values are wrong. Rather I think there is some bandwidth limitation that will mute the colors quite a bit. Increasing the filtering to an aggressive level results in this:
As you can see, the bandwidth of the Famicom’s video output is a key parameter here that alters color saturation. Normally, bandwidth would not effect color to this degree. It does so in this case because the Famicom’s video generation is pulse-based, allowing for a high degree of harmonics.
Here is a consumer preset for PAL NES. I also got around to fixing the slot mask. This preset is meant to be low TVL.
A new version is ready: https://github.com/anikom15/scanline-classic/releases/tag/v10.1
This version includes the Famicom/NES presets as well as a global options file. @PU786 this will allow you to turn off the bezel and force flat geometry across all presets. Debug options have to be explicitly enabled to work; this may give a slight performance boost.
From the README:
Scanline Classic ships with a global options skeleton at config/options.skel.cfg.
To use it, copy it to config/options.cfg in your Scanline Classic install, then uncomment the #define lines you want to enable.
This lets you turn on global compile-time options such as disabling bezel rendering and forcing flat geometry.
The config folder is in the root scanline-classic folder, normally installed in bezel.
The doc folder has also been comprehensively updated.
There’s so much attention to detail here in console quirks and display variants that it just blows me away! And thank you for adding that option.
I feel like there’s presets for every major console I see players tend to emulate, except for the Saturn and Dreamcast. I don’t really know if there’s anything special needed for the Saturn (I see your post about it having two video clocks and AFAIK it’s basically generic but needs the Sega Luma Fix from Grade), but I’m exceedingly interested in seeing 480p composite and RGB-PVM shaders for the Dreamcast.
Getting accurate Dreamcast shaders feels like the dream. Pun intended. : )
These look great! However I’m getting visual glitches on consumer nes and snes (uhd-4k-sdr) presets. The color pallette on nes is all messed up and on snes-eu has a zoomed in image.
I’m running Vulkan on RTX 4070, 2160p (monitor resolution). I couldn’t find any mention of these glitches so I thought I would ask directly. Any idea why this is happening? Thanks.
(last image no shaders)
For EU, you must be running a core in PAL mode (50 Hz).
For Famicom/NES, you need to use Mesen’s raw palette. If you don’t want to use the raw palette or Mesen, then you can use one of the SFC/SNES presets as the timing is identical.
Working on an RGB-centric noise shader, applicable to arcade, SCART, etc. Three ‘noise grades’ are available as well as a custom mode: professional, consumer, and degraded.
Pro
Consumer
Degraded
Pro
Consumer
Degraded
Some discussion on how the RGB noise injection works: aside from jitter and white noise, crosstalk is added to the RGB output in a few ways:
- Crosstalk from each of the three channels onto each other
- Crosstalk from ‘ground bounce’ or any H-sync–aligned feedthrough
- Crosstalk from the subcarrier (if present)
For a somewhat realistic crosstalk effect I tried to simulate high frequency effects on the channels. This is done by first calculating the difference of the input pixel with the one on its left:
This screenshot has contrast increased for visibility. A custom mipmapping shader is chained to create mipmaps, enabling us to average the result at different lengths. Depending on how much interference we want to create, we select an average length and use that to envelope crosstalk.
Here is an example of extreme red/green crosstalk. High frequency green periods create red smears. High frequency red periods create green smears. Blue/green crosstalk is done in the same way.
At low levels, the approach is decent. At high levels, it breaks down largely due to the symmetric filtering of the mipmaps and that’s something I may be able to work out further. It also doesn’t consider any second-order effects.
The other two forms of crosstalk are simpler, being based on fixed tones and harmonics. For ground bounce, a tone related to H frequency is selected, and the starting harmonic can be chosen depending on how many ‘jail bars’ one wants. A ‘saggy saw’ response of this tone is computed and applied to all three channels equally:
The final method is simulating subcarrier leakage, where the fundamental is chosen as the subcarrier. Not all systems have a subcarrier present and can indicate this by setting subcarrier mode to off. The subcarrier leakage primarily affects blue, then green, and red (this aligns with some real designs). On the SFC this results in diagonal artifacts, but the direction is system-dependent. For example, on Mega Drive and Neo Geo AES this will manifest as fine jailbars. For a noisier response, a harmonic sum is computed instead of a pure sine tone (this results in the faint vertical lines in the screenshot).
Maybe I don’t get this, is it supposed to simulate noise (cable interference) from an rgb signal like scart?















