The Scanline Classic Shader

I found an issue with the generic presets, but it looks like that’s unrelated. I can’t reproduce your bug, so this may be hardware dependent. Do you mind creating an issue on Github and uploading a log? You will need to enable both logging and the performance counters within the RA UI under the Logging menu.

I am guessing the output framebuffer of the frame shader is not the size being requested.

Version 6.2.1 with fixes for generic presets is available.

3 Likes

This is the 3DO. The 3DO always outputs 480i (with one exception, see below). Since the 3DO emulator doesn’t implement the system’s interpolation, I’ve attempted to replicate with simulated data. This interpolation shader, if successful, will be released separately. The missing data is estimated with a simple luminance edge detector. It ends up being very similar to the bilinear filter but is slightly sharper. I don’t even know if this game used the interpolator. Apparently games could disable the interpolator (outputting 480i via nearest neighbor) and the Japanese 3DO had a 240p mode available through a toggle switch (no scaling at all).

This screenshot has the deflicker enabled so that both fields can be seen at once. Picture was also increased a bit.

6 Likes

Another 3DO screenshot, this time composite, lower TVL.

2 Likes

3DO is pretty much finished and will be in the next update. I have also been able to get the shaders to be stable at all of the PSX’s many video modes. The Saturn has two separate video clocks however, which is a bit weird, so cannot work without some modifications to how timing is derived. The N64 should be trivial.

3 Likes

Do you plan on making 1080p presets in the future?

I have used the presets on 1920x1200 and they seem okay to me. Maybe some aliasing with the mask, but not too bad. Do you think dedicated 1080p presets would be useful?

1 Like

Hmm, I’m not an expert on CRT masks but I was intimidated by the folder names having tags like 4k uhd, and couldn’t tell if I’m getting the “intended” look or not.

Maybe instead of dedicated 1080p, an auto fit to resolution setting would be better?

I would start with trying out the presets on the resolution you want and see how it goes. If there are any issues or you think something looks off, let me know. I was thinking for 1080p, the presets would be nearly the same but use a lower TVL, maybe different mask diffusion. But I won’t be working on them for a while.

1 Like

The next update will be able to support shader subframes (for DOUBLE_REFRESH and phosphor). However, performance requirements are incredibly high, too high for my own system. Maybe a 4090 can run it :laughing:

4 Likes

Version 7 is available and also is in the RetroArch distribution.

6 Likes

A couple notes:

The presets are designed for native resolution. Some cores allow you to render the internal framebuffers at a higher resolution. These options should be disabled before applying a preset. The HDTV presets can accept an input size of up to 1125 pixels high, but I don’t test anything outside of native resolution and there may be issues with scaling due to H-sync timing derivation.

Some cores use hardware acceleration for rendering and this will require timesharing with the shader rendering. If you are running this type of core and encounter slowdowns, you can determine if the shader is the cause by disabling the video shader and seeing if full speed can be achieved. With recentish hardware a hardware accelerated core should not be needed as long as you are running native res until you get to the N64 or so (i.e. you can use the software Beetle PSX renderder).

1 Like

The next version will have HDR support. The other SDR modes will also have better tone-mapping. Default settings will result in a much brighter image.

3 Likes

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:

3 Likes

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.

1 Like

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.

1 Like

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.

1 Like

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.

5 Likes

The next update will have further bezel improvements: better performance and looks better too I think.

7 Likes