Aspect ratio

Aspect ratio is a term which refers to the ratio between the width and height of a logical frame buffer, called the logical aspect ratio, or a physical video display device, called the physical aspect ratio.

Vanilla Doom


Vanilla Doom ran only in a tweaked VGA "Mode Y" 320x200 video mode. On properly configured CRT monitors, which were the only widely available and inexpensive consumer display device for computers at the time, this video mode took up the entire screen, which had a 4:3 physical aspect ratio. This meant that the 320x200 display, with a 16:10 logical ratio, was stretched vertically - each pixel was 20% taller than it was wide.

Design of graphics
Most of the Doom in-game graphics appear to have been specifically designed for the 320x200 resolution as stretched to a 4:3 physical aspect ratio; for example, the appearance of the title screen better matches the Doom box art when using the rectangular pixels unique to this hardware video mode. Similarly, the shape of the status bar face better matches the dimensions of a real human face.

When Doom's graphics are displayed inside a square-pixel, 4:3 screen mode (640x480 or 800x600, for example), they will appear "squashed" relative to how they appear in the game.

Because screenshots only capture the logical frame buffer contents and are not affected by the VGA rasterization process, they will similarly appear flattened (in the 16:10 logical ratio) when viewed inside a square-pixel screen mode.

Source ports
Various problems arise for source ports in the area of supporting Doom's natural 4:3 aspect ratio. Support for Mode 13h, and especially for undocumented VGA tweaks like those used by Doom, has dropped to near non-existence in modern video hardware and operating systems. For example, flat panel high-definition monitors are now the default, and virtually all have a physical aspect ratio of 16:9 or 16:10. Even if Mode 13h were successfully displayed in fullscreen on these monitors, it would appear incorrect, barring possible low-level pillarboxing implemented in the monitor's firmware or video card drivers.

Source ports are additionally expected to be able to run in higher resolutions, inside windows on graphical desktops, and in widescreen modes. Each of these has a special set of problems.

Aspect ratio correction
Some source ports include aspect ratio correction. This performs stretching of the logical frame buffers's contents when running in a 4:3 screen mode, so that the graphics appear as they appeared in Vanilla Doom. This is generally accomplished in one of two ways:


 * Graphical scaling : In this approach, the individual components of the screen are scaled to fit the 4:3 mode or window as they are rendered. This is accomplished by altering the three-dimensional projection math throughout the renderer to take into account aspect ratio multipliers. Other graphics, such as the status bar, may be drawn stretched. This is the approach taken by ZDoom, Eternity, and most other ports that can render in extended resolutions. Note that the automap is not generated by the rendering engine, so it does not automatically inherit the aspect ratio correction of a given port (see figure). It can be given its own correction via the addition of scaling multipliers, however.


 * Whole-screen correction : With whole-screen correction, the screen is rendered to the original 320x200 size. Low-level graphics code then stretches the entire screen to fit the 4:3 graphics mode or window. A disadvantage of this approach is that the screen may appear blurry due to the stretching, as the pixels are not "multiplied" by integral numbers &mdash; unless the target resolution is a multiple of 1600x1200. This is the approach used by Chocolate Doom for aspect ratio correction. The corresponding square-pixel resolution which appears correct for 320x200 is a multiple of 320x240.

Widescreen modes
Widescreen modes add an extra level of complication to the aspect ratio issue. Most modern monitors have a physical 16:9 or 16:10 aspect ratio, rather than the "traditional" 4:3 aspect ratio. In this scenario, the aspect ratio correction should still be performed. The extra horizontal space is properly used by either increasing the horizontal field of view or by simply filling it with a black border, which is referred to as "pillarboxing."

Different aspect ratios
Some source ports handle 4:3 screen modes incorrectly. An example is Doom 95, which renders the screen in 640x480 mode without any correction for the different aspect ratio. This leads to an expansion of the vertical viewable area. The result is that the player can see more when running in 640x480 mode than in 320x200 or 640x400 mode.

Doom Legacy and ReMooD both lack support for any form of aspect ratio correction. That is, the screen only displays correctly when running on a 4:3 display. These ports do not adapt the aspect ratio for rendering on different screen modes, so the screen will appear stretched or squashed depending on the ratio of the dimensions of the screen mode used.