libretro / libretro/RetroArch

[Feature Request] (BFIv2) BFI is more CRT-like at higher Hz. Need 60Hz BFI for 180Hz, 240Hz, 300Hz, 360Hz

Open
#10,754 16 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request prs welcome
Dominant language
C
Stars
14.1k
Forks
2.2k
Avg merge
7h 35m
Merged PRs (30d)
51

Description

New Methods of Emulating CRT Via Sheer Hz

I'm the founder of Blur Busters and creator of TestUFO. Today, we now have 240Hz 1ms IPS panels, and DELL is releasing a 360Hz IPS monitor this summer. This is an amazing opportunity for emulation.

Glossary
BFI = Black Frame Insertion, used to reduce motion blur on LCDs to mimic a CRT
BFIv1 = Classic 60fps at 120Hz BFI, already implemented in RetroArch
BFIv2 = Improvements to BFI for higher Hz, FOCUS OF THIS GITHUB ITEM
BFIv3 = Rolling-bar BFI, emulating CRT electron gun temporally, See GitHub #10757

Retroarch already supports 60Hz BFI for 120Hz

60Hz Black Frame Insertion (BFI) improves massively at higher refresh rates for multiple reasons. Strobed and non-strobed. RetroArch already supports 60 Hz software BFI for 120Hz displays.

To understand black frame insertion, see animation demo: www.testufo.com/blackframes

This works great, and is already discussed in this libretro thread

Newer monitors already actually improved BFI in existing RetroArch. For example, 120Hz strobed on 240Hz panels look better than 120Hz strobed on 144Hz panels. And 240Hz IPS just came out too (better colors). 240Hz 1ms IPS strobed monitors look far better than old LightBoost panels, such as the Blur Busters Approved ViewSonic XG270 gaming monitor 240Hz 1ms IPS panel, which looks great with existing 120Hz PureXP+ on existing RetroArch BFI

Discovery That Higher Hz Improves Software BFI (240Hz, 360Hz)

We discovered that higher refresh rates improve software BFI even further for many reasons such as:

  • Even less motion blur
  • Adjustable-brightness BFI
  • Adjustable-blur BFI
  • Eliminate image retention (burn in)
  • Eliminate chessboard pattern artifacts
  • Eliminate banding/contouring (color depth loss)
  • For Manufactures, Higher Hz also improves lower-Hz strobe (reduced crosstalk)
  • For Developers, Higher Hz also produces more opportunities to emulate CRT zero-blur
  • For User, Higher Hz also reduces emulator lag, and mimic a CRT better

Animation Demonstration:

  • If you have a 60Hz monitor, animations will be very limited in explaining BFI, but you can view this Simple 60Hz Demo of Three Different BFI Motion Blurs. This will run at only 20 frames per second, but will adequately demonstrate the variable-blur BFI concept via custom blackframe sequences.

  • If you have a 240Hz monitor in sample-and-hold mode, view this upgraded TestUFO Variable-Blur Variable-Brightness BlackFrames Comparison. You'll immediately see the pros/cons. You can still view this on a 120Hz monitor to see this in a kind of a slow-motion, at least to gain a better understanding.

  • If you have a 120Hz monitor in LightBoost mode with a chessboard-pattern problem, view this upgraded TestUFO Inversion-Artifact-Proof BlackFrames Animation, you'll see the last UFO no longer have a chessboard pattern artifact. But it only runs at 40 frames per second. Chessboard patterning is often an issue on TN panels due to voltage inversion. Fixing this requires a 240Hz monitor configured to 180Hz with strobe enabled (e.g. BenQ XL2546 monitor, ViewSonic XG270 monitor). This, incidentially is also burnin-proof too.

  • Fun Education: There is now a TestUFO emulation of CRT 30fps at 60Hz side effect. This is just an educational exercise on how software BFI can still emulate the side effects of a CRT (half frame rate behavior). Mind you, this animation looks more correct on a 120Hz monitor, because it requires a 4-refresh sequence, but it's still passable education at any refresh rate.

Eliminates Image Retention

Odd-divisible refresh rates (180Hz and 300Hz) are completely image-retention-proof, since it doesn't interfere with LCD voltage inversion electronics. BFI is completely safe on all 180Hz-capable and 300Hz-capable monitors. Most 240Hz gaming monitors are capable of doing a 180Hz refresh rate.

FEATURE REQUEST:

Support Adjustable Software BFI for Higher Hz

We neeed RetroArch to support the following Black Frame Insertion (BFI) sequences:

BFI sequence on 120Hz for 60Hz emulation: ON, OFF
BFI sequence on 180Hz for 60Hz emulation: ON, OFF, OFF
BFI sequence on 240Hz for 60Hz emulation: ON, OFF, OFF, OFF
BFI sequence on 300Hz for 60Hz emulation: ON, OFF, OFF, OFF, OFF
BFI sequence on 360Hz for 60Hz emulation: ON, OFF, OFF, OFF, OFF, OFF

Best Case Display Motion Blur Reduction by BFI

The easiest way to do so is provide a comma-separated black-frame insertion sequence in a configuration file, to allow customizability. Default strings can be done for common scenarios, but would let advanced users customize BFI. Relative to the original blur of a 60Hz LCD, higher Hz produces more software-BFI-blur-reduction (non-strobed LCD use-case, though software BFI also helps hardware strobing too for these specific numbers, in lower strobe lag + better quality strobing).

120Hz BFI sequence (50% less motion blur): 1 , 0
180Hz BFI sequence (66% less motion blur): 1 , 0 , 0
240Hz BFI sequence (75% less motion blur): 1 , 0 , 0 , 0
300Hz BFI sequence (80% less motion blur): 1 , 0 , 0 , 0, 0
360Hz BFI sequence (83% less motion blur): 1 , 0 , 0 , 0 , 0 , 0

Adjustable Motion Blur (Tradeoff Between Flicker + Brightness + Clarity)

Custom sequences can allow you to adjust motion blur, brightness, and flicker tradeoff. Just like TestUFO Variable-Blur BFI Demo. Try this link on a high-Hz LCD with hardware strobing distabled! If you have 240Hz, try configuring 4 or 5 UFOs instead, to see more variable-blur flexibility. Adjustability is a continuum between hardware Hz to emulator Hz. Minimum persistence-based display motion blur is persistence of max Hz (1/360sec visibility = 2.8ms blur). Maximum display motion blur is emulator Hz (1/60sec visibility = 16.7ms blur). Thus higher Hz, the more BFI motion blur adjustability.

180Hz bright BFI sequence (33% less motion blur): 1 , 1 , 0
240Hz bright BFI sequence (25% less motion blur): 1 , 1 , 1 , 0
360Hz bright BFI sequence (66% less motion blur): 1 , 1 , 0 , 0 , 0 , 0
360Hz bright BFI sequence (33% less motion blur): 1 , 1 , 1 , 1, 0 , 0

Basic CRT Phosphor Decay Emulation

In fact, alpha-blended BFI is also desirable, so this could be a percentage setting or floating point setting, to approximate phosphor fade. This makes flickerfeel more approximate a CRT tube (as far as refresh granularity permits). And feels much less harsh than 60Hz squarewave for many.

240Hz alpha-blended BFI slow-rise slow-decay sequence: 0.5 , 1 , 0.5 , 0
360Hz alpha-blended BFI slow-rise slow-decay sequence: 0.5 , 1 , 0.5 , 0 , 0 , 0
360Hz alpha-blended BFI fast-rise, slow-decay sequence: 1 , 0.5 , 0.25 , 0 , 0 , 0
360Hz alpha-blended BFI fast-rise, superslow-decay sequence: 1 , 0.75 , 0.5 , 0.25 , 0.1 , 0

Alternative methods of configuration could be discussed instead.

Hopefully this is a very easy change for a RetroArchfor the refresh rate race to retina refresh rates. For now, this can be just a simple configuration file string, to help users incubate this. It should be easy to write instruction guides, to help get more users playing with BFI.

BFI Percentage Terminology (in case it wasn't clear)
1 = Fully visible frame
0 = Fully black frame
0.5 = A darkened frame that is 50% brightness

Tips

  • Comma sequences too long for current actual-hardware refresh rate can simply be trunctated for lower Hz. So "1,0,0,0,0,0" can become catchall for all refresh rates
  • Comma sequences too short for current actual-hardware refresh rate can simply pad missing values as 0
  • First number should be non-blank for lowest lag. For convenience, config file reader can automatically numbershift to lag-optimize user-defined setting, e.g. turn "0, 1, 0.5, 0" into "1, 0.5, 0, 0". It is visually identical but lower lag.
  • The numbershifting technique can also be used as the anti-retention technique (can be enabled by default for hardware Hz evenly divisible by emulator Hz, such as 120,240,360 instead of 180,300, for 60Hz emulators).
  • Future Rolling BFIv3 (github #10757 ...) could actually theoretically use the same BFIv2 strings, simply by using 6 different numbershifted versions of the same strings for 6 slices for the same 360Hz display (360/60 = 6). Or 4 different numbershifted versions of the same strings for 4 slices of the same 240Hz display (240/60 = 4). For some developers, this can theoretically make BFIv3 conceptually simpler to implement (for all phosphor fade speeds), albiet alphablended overlaps will still be needed to eliminate seams/tearing artifacts. You'd simply add a command line argument "rolling = on/off". Although this may not be the most ideal coding path, explaining it this way, may be more conceptually simple for a developer how to visualize how to turn global BFIv2 into a rolling BFIv3 later on in the future, as a stopgap...

Once this feature is implemented, I'd be happy to write an article about this to improve emulator BFI awareness among high-Hz monitor users

Hopefully this is a very easy change for RetroArch for the refresh rate race to retina refresh rates. For now, this can be just a simple configuration file string, to help users incubate this. It should be easy to write instruction guides, to help get more users playing with BFI.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. Start by locating RetroArch’s existing 120Hz BFI implementation and configuration path, then determine how higher-refresh-rate and alpha-blended sequences would be represented. Done means supporting the requested 180Hz, 240Hz, 300Hz, and 360Hz BFI sequences with configurable behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.