11 June 2016

GLSL Revisited: newer CRT-geom Shader

I finally found a version of the CRT-Geom Shader that incorporates the Bloom Effect, you can download the 2015 version here: https://sites.google.com/site/o0kinghanco0o/crt-geom-alternative-downloads

File: CGWG-CRT-geom-halation-20151123.zip
Applied changes:

  • Gamma values to more saturation (better black) 
  • No Overscan effect, since I like to see everything (here I need no Retro feeling)
  • Radius of curvature and viewer distance changed a bit.
  • Significantly reduced the Bloom effect. 
These are my settings (with changes in red):

// START of parameters

  // gamma of simulated CRT
  CRTgamma = 2.2;
  // gamma of display monitor (typically 2.2 is correct)
  monitorgamma = 2.0;
  // overscan (e.g. 1.02 for 2% overscan)
  overscan = vec2(1.00,1.00);
  // aspect ratio
  aspect = vec2(1.0, 0.75);
  // lengths are measured in units of (approximately) the width of the monitor
  // simulated distance from viewer to monitor
  d = 3.0;
  // radius of curvature
  R = 2.0;
  // tilt angle in radians
  // (behavior might be a bit wrong if both components are nonzero)
  const vec2 angle = vec2(0.0,0.01);
  // size of curved corners
  cornersize = 0.03;
  // border smoothness parameter
  // decrease if borders are too aliased
  cornersmooth = 80.0;
  // strength of halation or "bloom" effect - e.g. 0.1 for 10%
  halation = 0.05;

  // END of parameters

As explained on the website, you should run the following chain of shaders (incorporating the correct path as explained in my previous post):

glsl_shader_mame0 gaussx
glsl_shader_mame1 gaussy
glsl_shader_mame2 CRT-geom-halation

The result is very decent, the new Bloom effect makes a difference in practice:


  1. This comment has been removed by the author.

  2. On the same page they also have the CRT-geom converted to a BGFX version.

    If your machine can handle BGFX it's nice since you can modify those parameters directly in MAME rather than editing text files.

    1. Hey Headrush69 I am experiencing a major issue with BGFX - could you please try this: Start MAME with the internal MEWUI, then switch Video to BGFX and then try to configure a single machine. In such cases MAME severely crashes, and switching back to OpenGL from BGFX does not help, I need to restart with a clean install. This is why BGFX is not ready for me yet and I prefer staying with OpenGL and this enhanced shader. Many thanks for you feedback!!!

  3. I tried as you suggested but it did not crash for me.
    In testing it did not switch to BGFX either it seems.
    BGFX does work if set on command line or started in using QMC2 with that option.


Any comments are welcome!