Difference between revisions of "Aspect ratio"

From DoomWiki.org

[unchecked revision][checked revision]
m (Design of graphics)
(48 intermediate revisions by 12 users not shown)
Line 1: Line 1:
[[Vanilla Doom]] runs in [[Wikipedia:VGA|VGA]] 320x200 mode, which is an 8:5 '''aspect ratio'''.  This causes problems on some modern computers which only support 4:3 ratio graphics modes.  Some [[source port]]s support aspect ratio correction, which attempts to remedy this.
+
'''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.
  
Almost all monitors have a physical size where the width and height of the screen are in a 4:3 ratio.  However, Vanilla Doom used a 320x200 screen resolution.  Because of the difference in aspect ratio between the screen resolution and the physical dimensions of the screen, the 320x200 screen is stretched.  The effect of this is that the pixels displayed on the screen are not square: they are each slightly taller than they are wide.
+
==Vanilla Doom==
  
Some modern graphics cards and monitors only support 4:3 screen resolutions, and so Doom's native 320x200 resolution is not supported.  In these cases, the screen may be displayed within a higher screen resolution, resulting in black borders at the top and bottom of the screen.  For example, 320x200 mode games may actually
+
[[Image:Aspect-ratio-titlepic.png|thumb|right|Aspect ratio corrected and uncorrected versions of the [[Doomguy]]'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.]]
run in 320x240 mode (a 4:3 resolution).
 
  
The effect of running with borders like this is that the screen appears squashed compared to the original Vanilla Doom, as everything
+
[[Vanilla Doom]] ran only in a tweaked [[Wikipedia:VGA|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.
physically appears 16% shorter. It appears that the doom graphics have been specifically designed for the 320x200 resolution; for example, the shape of the [[status bar face]] better matches the dimensions of a real human face when run in the stretched mode.  Similarly, [[Cacodemon]]s appear more round.
 
  
== Aspect ratio correction ==  
+
===Design of graphics===
[[Image:Aspect_Ratio_Mona_Lisa.png|thumb|right|An aspect ratio-corrected version of the status bar face compared with the Mona Lisa and an uncorrected version. The version with aspect ratio corrected better matches the shape of the human face.]]
+
[[File:Aspect_Ratio_Mona_Lisa.png|thumb|Comparison of {{wp|Mona Lisa}} and the [[Doomguy]]. The image on the left is corrected; the one on the right is not.]]
Some [[source port]]s include '''aspect ratio correction'''. This performs stretching of the screen's contents when running in a 4:3
+
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. Doom's artists ([[Adrian Carmack]] and [[Kevin Cloud]]) used [[wikipedia:Deluxe Paint|Deluxe Paint II]] for DOS to produce the artwork for the game,{{cite web|author=[[John Romero|Romero, John]]|title=doom history 1994|url=https://web.archive.org/web/20090801115916/http://rome.ro/wordpress/?p=3|publication=rome.ro blog post|publishdate=15 January 2009|accessdate=25 October 2015}} which would have used the same 320x200 video mode as the game itself.
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.  For example, the renderer is run in a way such that the game view is stretched to fit the screen.  Other graphics, such as the status bar, are drawn stretched.  A disadvantage to this approach is that some of the graphics (such as the status bar) may appear distorted due to the scaling. This is the approach taken by [[ZDoom]].
+
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.
  
; Whole-screen correction : With whole-screen correction, the screen is rendered to a 8:5 size.  The low-level graphics code then stretches the entire screen to fit the 4:3 graphics mode.  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.
+
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.
  
== Incorrect aspect ratio ==
 
[[Image:Doom95-MAP01-Start.png|thumb|right|The start of [[MAP01: Entryway (Doom II)|MAP01]] as it appears in [[Doom 95]].  Compare with [[:Image:MAP01.png|how this normally appears]].]]
 
Some source ports do not handle 4:3 screen modes correctly.  An example is [[Doom 95]], which renders the screen with the wrong aspect ratio when running in 640x480 mode.  The result is that the player can see more when running in 640x480 mode than in 320x200 or 640x400 mode.
 
  
== Choosing a graphics card ==
+
<gallery mode=nolines widths=320px>
 +
Aspect ratio comparison mancubus.jpg|The mancubus sprites demonstrate that aspect ratio correction is necessary to have a more consistent shape for their flamethrowers between the horizontal posture for firing and the vertical posture from the pain frame.
 +
Aspect ratio comparison cyberdemon.jpg|The cyberdemon sprite shows that its proportions with aspect ratio correction match its [[models|physical model]] closely, while it looks squashed with square pixels.
 +
</gallery>
  
The aspect ratio issue may be an important issue to Doom fans when choosing a graphics card, as support for the 320x200 mode seems to be mainly dependent on the graphics card manufacturer.  [[Wikipedia:NVIDIA|NVIDIA]] cards seem to properly support the 8:5 ratio modes, for example, while [[Wikipedia:ATI|ATI]] cards do not.
+
==Source ports==
 +
Various problems arise for [[source port]]s 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===
 +
[[Image:Am_stretch.png|right|thumb|180px|A rectangular room in [[E1M3: Toxin Refinery (Doom)|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 Engine|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 windowA 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===
 +
[[Image:Aspect_diagram.png|thumb|right|When set up correctly, 16:10 widescreen displays a wider area than 4:3 fullscreen, not a shorter area.]]
 +
[[Wikipedia:Widescreen|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.
 +
 
 +
Though [[Doom (Apple Macintosh)|the Apple Macintosh port]] of the Doom games is designed to run on a square pixel display, and supports both 320x200 and 640x400 resolutions, it does not implement any form of aspect ratio correction and thus the game always appears flattened.
 +
 
 +
[[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.
 +
 
 +
<gallery class="center" widths="640px" heights="240px">
 +
Doom95Comparison.png|A direct comparison of Doom95 at 640x480 and the same scene as rendered by an aspect-correct source port.
 +
</gallery>
 +
 
 +
==References==
 +
<references />
  
 
[[Category:Technical aspects]]
 
[[Category:Technical aspects]]
 
[[Category:Source ports]]
 
[[Category:Source ports]]

Revision as of 04:38, 21 December 2018

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 Doomguy'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 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

Comparison of Mona Lisa and the Doomguy. The image on the left is corrected; the one on the right is not.

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. Doom's artists (Adrian Carmack and Kevin Cloud) used Deluxe Paint II for DOS to produce the artwork for the game,[1] which would have used the same 320x200 video mode as the game itself.

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

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, as the pixels are not "multiplied" by integral numbers — 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

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

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.

Though the Apple Macintosh port of the Doom games is designed to run on a square pixel display, and supports both 320x200 and 640x400 resolutions, it does not implement any form of aspect ratio correction and thus the game always appears flattened.

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.

References

  1. Romero, John (15 January 2009). "doom history 1994." rome.ro blog post. Retrieved 25 October 2015.