Someone try the crt beam shader for mpv ?

Everything about displays and monitors. 120Hz, 144Hz, 240Hz, 4K, 1440p, input lag, display shopping, monitor purchase decisions, compare, versus, debate, and more. Questions? Just ask!
Post Reply
atohmdiy
Posts: 2
Joined: 20 Dec 2025, 12:31

Someone try the crt beam shader for mpv ?

Post by atohmdiy » 20 Dec 2025, 12:50

I saw there is this person, gavtroy, that release the crt beam emulation shader for mpv on github. I'm asking myself if someone give it a try, i haven't much success with it. It is working but i get random rainbow color and a transparent black bar in the middle of the screen.
I try it in my lg cx48, targetting 120hz refresh and a 60fps video, here is my settings (no hdr) :

Code: Select all

//!PARAM FRAMES_PER_HZ
//!TYPE float
2.0

//!PARAM GAIN_VS_BLUR
//!TYPE float
//!MAXIMUM 1.0
0.5

// Constants Definitions

  // Depending on the file this doesn't seem to work well. Comment out for generic fallback using GAMMA defined below.
//#define MPV_LINEARIZE

  // Your display's gamma value. Necessary to prevent horizontal-bands artifacts.
#define GAMMA           2.2

  // Splitscreen versus mode for comparing to non-CRT-simulated
#define SPLITSCREEN_X   0.50     // For user to compare; horizontal splitscreen percentage (0=verticals off, 0.5=left half, 1=full sim).
#define SPLITSCREEN_Y   0.00     // For user to compare; vertical splitscreen percentage (0=horizontal off, 0.5=bottom half, 1=full sim).
#define SPLITSCREEN_BORDER_PX 2  // Splitscreen border thickness in pixels
#define SPLITSCREEN_MATCH_BRIGHTNESS 1    // 1 to match brightness of CRT, 0 for original brightness of original frame

  // Reduced frame rate mode
  //   - This can be helpful to see individual CRT-simulated frames better (educational!)
  //   - 1.0 is framerate=Hz, 0.5 is framerate being half of Hz, 0.1 is framerate being 10% of real Hz.
#define FPS_DIVISOR     1.0    // Slow down or speed up the simulation

  // LCD SAVER SYSTEM
  //   - Prevents image retention from BFI interfering with LCD voltage polarity inversion algorithm
  //   - When LCD_ANTI_RETENTION is enabled:
  //     - Automatically prevents FRAMES_PER_HZ from remaining an even integer by conditionally adding a slew float.
  //     - FRAMES_PER_HZ 2 becomes 2.001, 4 becomes 4.001, and 6 becomes 6.001, etc.  
  //     - Scientific Reason: https://forums.blurbusters.com/viewtopic.php?t=7539 BFI interaction with LCD voltage polarity inversion 
  //     - Known Side effect: You've decoupled the CRT simulators' own VSYNC from the real displays' VSYNC.  But magically, there's no tearing artifacts :-)
  //     - Not needed for OLEDs, safe to turn off, but should be ON by default to be foolproof.
#define LCD_ANTI_RETENTION  false
#define LCD_INVERSION_COMPENSATION_SLEW 0.001

  // CRT SCAN DIRECTION. Can be useful to counteract an OS rotation of your display
  //   - 1 default (top to bottom), recommended
  //   - 2 reverse (bottom to top)
  //   - 3 portrait (left to right)
  //   - 4 reverse portrait (right to left)
#define SCAN_DIRECTION 1

Post Reply