Aspect ratio

From DoomWiki.org

Revision as of 10:52, 30 April 2010 by Quasar (talk | contribs) (Moved some images)


Information icon.svgThis article or section needs to be cleaned up. Please edit it to conform to a higher standard of article quality.

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

Aspect ratio corrected and uncorrected versions of the Doom guy's face on the Doom title screen, compared with the version from the box art, strongly suggesting that Doom's in-game graphics were designed specifically for the tall pixels of the 320x200 screen mode.

Vanilla Doom ran only in a tweaked VGA "Mode 13h" 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

Comparison of Mona Lisa and the Doomguy.

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.

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

A rectangular room in E1M3 is distorted in the automap.

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. This is the approach used by Chocolate Doom for aspect ratio correction. The corresponding square-pixel resolution which appears correct for 320x200 is 320x240.

Widescreen modes

When set up correctly, 16:10 widescreen displays a wider area than 4:3 fullscreen, not a shorter area.

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

The start of MAP01 as it appears in Doom 95. Compare with how this appears in the original Doom.

Some source ports handle 4:3 screen modes in a different fashion. An example is Doom 95, which renders the screen with a different type of aspect ratio correction when running in 640x480 mode. Instead of stretching the pixels, it expands the viewable area. The result is that the player can see more when running in 640x480 mode than in 320x200 or 640x400 mode.

File:Remood7681024.png
The start of MAP01 as it appears in ReMooD
Doom Legacy and ReMooD are both locked in a 4:3 aspect ratio, however it is only effective if the full size image matches that aspect ratio. That is, regardless of what resolution the game runs at, as long as the screen fits a 4:3 display it will appear correct. Using a mode such as 320x240 or 640x480 on a 4:3 display will result in over stretching but will appear correct on a 1:1 display. Using 320x200 or 640x400 on a 4:3 display will appear correct but will be shrunken on a 1:1 display. This results in a constant viewed area, but at the expense of correct appearance in any screen resolution or window size.