Skip to content

Shaders¶

DOSBox Staging uses adaptive CRT shaders by default that emulate the look of period-appropriate PC monitors from the 1980s and 90s. A VGA game gets a VGA-style CRT look, an EGA game gets an EGA-era monitor, and so on. The results are very close to what these games looked like on the real hardware they were designed for. If you prefer a crisp “sharp pixel” look without any CRT emulation, set shader to sharp.

Adaptive CRT shaders¶

The default CRT shader is adaptive: it changes its monitor emulation to match the kind of video output the game is producing. A VGA game gets the characteristic double-scanned, sharp “chunky pixel” look of a VGA monitor, while an EGA or CGA game gets the single-scanned “thick scanline” look and a slightly blurrier output. This is important because simply applying the same CRT effect to every DOS game wouldn’t reproduce how these machines actually looked.

There are several adaptive CRT shader variants, each intended for a different kind of experience. The default crt-auto follows the video standard used by the game rather than the video adapter configured in DOSBox Staging. Thus an EGA game gets EGA monitor emulation with “thick scanlines” even when machine is set to a VGA adapter. The crt-auto-machine variant instead follows the configured video adapter, while the two crt-auto-arcade variants deliberately emulate the thicker scanlines of an arcade or home-computer display. See the shader setting for the complete list of options.

The adaptive shaders also take the available viewport size into account. They need enough vertical resolution to produce clean scanlines, and different shader variants are used at different scaling ratios. Generally, CRT shaders need at least three times the vertical resolution of the emulated video mode to produce the intended CRT effect (e.g., 800Ă—600 SVGA requires at least 1800 vertical pixels). If the viewport becomes too small, CRT emulation is disabled and DOSBox Staging falls back to the sharp shader.

This means the shader can change even though the game and its video mode have not changed. Resizing the window or switching between windowed and fullscreen mode changes the available viewport size and can therefore cause DOSBox Staging to select a different shader. With integer_scaling enabled by default, the scaling factor can change at the same time, so the amount of black padding around the image can change too. This is normal; see Why is there a black border? and Integer scaling for an explanation.

If you’re unsure which adaptive CRT shader to use, leave it at the crt-auto default — this is the best choice for most users.

1080p special cases¶

The adaptive CRT shaders normally require at least three times the vertical resolution of the emulated DOS video mode with vertical integer_scaling enabled to display crisp scanlines without wavy vertical interference patterns. On a 1080p display, a double-scanned 320Ă—200 game has an effective height of 400 lines, which means the highest usable integer scale is 2Ă— in fullscreen, leaving substantial black borders around a relatively small upscaled image. Two special shaders activate automatically under crt-auto to improve the situation:

  • vga-1080p-fake-double-scan — Used for 320Ă—200 content. Rather than treating the source image as 640Ă—400, this shader treats it as 320Ă—200 and applies a higher integer scale, then overlays an alternating line pattern to simulate the double-scan look. It’s not pixel-perfect (or rather, scanline-perfect), but the feel is authentic and the image fills the screen far better.

  • vga-1080p — Used for 640Ă—480 content. This mode upscales at exactly 2Ă— to 1280Ă—960 with the same alternating line overlay. Not fake double scanning — 640Ă—480 is a mode that doesn’t double-scan — just a purpose-built upscaler that makes the most of a 1080p viewport.

Both activate transparently under crt-auto. You can also set them explicitly via the shader setting, though in most cases there’s no reason to.

Note

Technically, these two special shaders are actived when the “native viewport height pixels” per “number of emulated scalines” ratio falls between 2.0 and 3.0 in the viewport. It’s just easier to call them “1080p shaders” because they’re most useful on 1080p monitors in fullscreen.

VGA double scanning¶

VGA adapters are the most common for DOS gaming, so it’s essential to understand one of their important peculiarities.

VGA hardware double-scans any video mode with fewer than 400 lines — it draws each scanline twice, producing two physical scanlines per each logical pixel row. This affects the most common DOS gaming resolutions: 320×200, 320×240, and 640×350 among others.

This is a fundamental difference from every graphics standard that came before it. CGA and EGA monitors, home computer monitors, and arcade monitors could all display “true” low-resolution video — one scanline per pixel row, exactly as the hardware produced it. On those displays, individual scanlines were thick and clearly visible, giving low-resolution content its characteristic chunky “fat scanline” look. VGA monitors physically could not do this. The signal frequency of a true 320×200 mode is incompatible with VGA monitors; double scanning was the only way to display it at all. With each line drawn twice, the resulting analog signal is literally identical to a true 640×400 mode — a VGA monitor has no way to distinguish between the two.

The scanlines on VGA monitors are vanishingly fine, closer in character to a high-end broadcast monitor than to the bold “chunky scanline” look of a CGA monitor or arcade cabinet. That refined, almost scanline-free look is what DOS VGA games looked like on real hardware. Instead of “chunky scanlines”, VGA monitors are known for their “chunky pixels” — in low-resolution modes, each 320×200 “pixel” was drawn as a sharp 2-by-2 pixel rectangle at 640×400 resolution.

This means the double-scanned rendering of low-resolution VGA modes is not a stylistic choice, not a DOSBox Staging quirk, and not something that can be “fixed” — it is the hardware reality of VGA. If you’re coming from experience with an Amiga, Atari ST, Commodore 64, a games console, or even a CGA or EGA PC, this will feel unfamiliar. That’s expected — VGA was genuinely different.

DOSBox Staging replicates this faithfully, and the adaptive CRT shaders are designed around it.

This has a direct consequence for integer scaling: a 320Ă—200 VGA game has an effective internal resolution of 640Ă—400. A 4Ă— integer scale therefore produces a 2560Ă—1600 image, not 1280Ă—800 (but we have implemented some special quality-of-life concessions for 1080p monitor users).

If you prefer the “chunky scanline” look of a CGA monitor or arcade cabinet — a look that was never actually available on VGA hardware — the crt-auto-arcade and crt-auto-arcade-sharp shaders offer exactly that as a deliberate fantasy option. It’s particularly enjoyable with DOS ports of Amiga and Atari ST games.

Why VGA double-scans low-resolution modes

CGA and EGA monitors operated at a lower horizontal sync frequency than VGA monitors, which standardised on a fixed higher rate. Existing DOS games used low-resolution modes that fell below VGA’s operating range, so IBM’s VGA hardware needed a way to bridge the gap. The solution was elegant: draw each scanline twice, doubling the number of output lines per frame and lifting the signal into VGA’s frequency range. The visual side effect — two physical scanlines per logical pixel row — gave low-resolution VGA games their characteristic “chunky pixel” appearance.

The real reason for this solution was to simplify the implementation and lower the cost of (at that time) high-resolution VGA monitors. Early VGA monitors were fixed-sync devices. SVGA monitors eventually evolved into multi-sync displays, but this early design decision stuck — most SVGA monitors never gained the ability to sync down to the 15 kHz horizontal rates necessary for displaying “true 200-line” content. This is why Amiga and Atari ST users needed to buy expensive scan doubler hardware to connect their computers to PC SVGA monitors.

Shader presets¶

Shaders can be configured with presets that override their default settings and parameters. Presets are specified using the SHADER_NAME:PRESET_NAME format in the shader setting. If no preset is specified, the shader’s built-in defaults are used.

For example:

[render]
shader = crt/crt-hyllian:vga-4k

The adaptive CRT shaders (crt-auto, crt-auto-machine, crt-auto-arcade, crt-auto-arcade-sharp) automatically select the appropriate preset based on the graphics standard and viewport resolution. For example, crt-auto might resolve to crt/crt-hyllian:cga-1080p for a CGA game at 1080p, or crt/crt-hyllian:vga-4k for a VGA game at 4K resolution. The sharp shader is used as a fallback below 3x vertical scaling.

Preset files are INI-format files that can override shader settings and parameters:

[settings]
force_single_scan = yes
force_no_pixel_doubling = yes

[parameters]
BEAM_MIN_WIDTH     = 0.70
SCANLINES_STRENGTH = 0.65

The [settings] section can include:

  • force_single_scan — Force single scanning for double-scanned modes. See VGA double scanning.
  • force_no_pixel_doubling — Disable pixel doubling. See VGA double scanning.
  • linear_filtering — Enable or disable bilinear texture filtering.

The [parameters] section overrides shader-specific parameters declared in the shader source.

Configuration settings¶

You can set the shader in the [render] configuration section.

shader¶

Set an adaptive CRT monitor emulation shader or a regular shader. Shaders are only supported in the OpenGL output mode (see output).

Adaptive CRT shader options:

  • crt-auto default – Adaptive CRT shader that prioritises developer intent and how people experienced the games at the time of release. An appropriate shader variant is auto-selected based on the graphics standard of the current video mode and the viewport size, irrespective of the machine setting.

  • crt-auto-machine – A variation of crt-auto; this emulates a fixed CRT monitor for the video adapter configured via the machine setting.

  • crt-auto-arcade – Emulation of an arcade or home computer monitor with a less sharp image and thick scanlines in low-resolution video modes. This is a fantasy option that never existed in real life, but it can be a lot of fun, especially with DOS ports of Amiga games.

  • crt-auto-arcade-sharp – A sharper arcade shader variant for those who like the thick scanlines but want to retain the sharpness of a typical PC monitor.

Other shader options include (non-exhaustive list):

  • sharp – Upscale the image treating the pixels as small rectangles, resulting in a sharp image with minimum blur while maintaining the correct pixel aspect ratio. Recommended for those who don’t want CRT shaders.

  • bilinear – Upscale the image using bilinear interpolation (results in a blurry image).

  • nearest – Upscale the image using nearest-neighbour interpolation (also known as “no bilinear”). This results in the sharpest possible image at the expense of uneven pixels, especially with non-square pixel aspect ratios (this is less of an issue on high resolution monitors).

The following short aliases are also available: sharp (for interpolation/sharp), bilinear (for interpolation/bilinear), nearest (for interpolation/nearest).

The bundled shaders include:

  • Interpolation: sharp, bilinear, nearest, catmull-rom

  • CRT: crt-hyllian, vga-1080p, vga-1080p-fake-double-scan (all used by the adaptive CRT shaders with different presets)

  • Scaler: advinterp2x, advinterp3x, advmame2x, advmame3x, xbr-lv2-3d, xbr-lv2-noblend, xbr-lv3

Shaders are located in subdirectories; use the full path (e.g., interpolation/catmull-rom or scaler/xbr-lv3). The .glsl extension can be omitted.

Note

Start DOSBox Staging with the --list-shaders command line option to see the full list of available shaders. You can also use an absolute or relative path to a file. In all cases, you may omit the shader’s .glsl file extension.