Difference between revisions of "Hall of mirrors effect"

From DoomWiki.org

[unchecked revision][checked revision]
(cheat code link now points to new article)
(Flat bleeding: Requires explanation of how this is related to HOM, as it itself is NOT HOM. It is the game filling in empty space using the visplane system.)
(17 intermediate revisions by 10 users not shown)
Line 1: Line 1:
 
[[image:HOM.png|thumb|320px|A rendering of the Hall of Mirrors effect]]
 
[[image:HOM.png|thumb|320px|A rendering of the Hall of Mirrors effect]]
In Doom, if the no-clipping [[Doom cheat codes|cheat]] is used to go outside the level, a shimmering mass is visible in the empty space outside, composed of parts of previous frames of animation. The same effect can be achieved by making a level with a wall which has no texture. This is called the '''Hall of Mirrors effect'''. The name comes from the fact that it appears somewhat like being in a hall of mirrors. It is sometimes abbreviated ''HOM'' or ''HOM Effect''.
+
Under the [[Doom engine]], if the no-clipping [[Doom cheat codes|cheat]] is used to go outside the level, a shimmering mass is visible in the empty space outside, composed of parts of previous frames of animation. The same effect can be achieved by making a level with a wall which has no texture. This is called the '''Hall of mirrors effect'''. The name comes from the fact that it appears somewhat like being in a [[Wikipedia:House of mirrors|hall of mirrors]]. It is sometimes abbreviated ''HOM'' or ''HOM effect''.
  
When Doom [[Doom rendering engine|renders]] the level to the screen, it draws it into a buffer, an area of memory. During gameplay, the previous contents of the buffer are overwritten by consecutive frames. However, if a player travels outside the level, there are no walls to draw, so Doom draws nothing. Instead, the previous contents of the buffer are displayed, left over from previous frames.
+
When the game [[Doom rendering engine|renders]] the level to the screen, it draws it into a buffer, an area of memory. During gameplay, the previous contents of the buffer are overwritten by consecutive frames. However, if a player travels outside the level, there are no walls to draw, so Doom draws nothing. Instead, the previous contents of the buffer are displayed, left over from previous frames.
  
If a player turns around and looks back toward the level, they can see through the [[wall]]s and inside the level. The floors of the level stretch outwards toward the screen edge in vertical columns. This is because the Doom floor and ceiling drawing system is like a flood fill algorithm: because there are no walls to bound them, they simply "bleed" down to the edges of the screen.
+
If a player turns around and looks back toward the level, they can see through the [[wall]]s and inside the level. The floors of the level stretch outwards toward the screen edge in vertical columns. This is because the Doom floor and ceiling drawing system is like a [[Wikipedia:Flood fill|flood fill]] algorithm: because there are no walls to bound them, they simply "bleed" down to the edges of the screen.
  
 
== Shimmering effect ==
 
== Shimmering effect ==
In [[Vanilla Doom]], a shimmering effect also occurs with HOM. The reason for this is in the Doom video system. Doom actually draws into two buffers alternately. This is called page flipping. While Doom is rendering into buffer 1, the video card is displaying the contents of buffer 2 (so it is not possible to see the screen until rendering has completed). When rendering is complete, it reverses ("flips") the buffers: the video card displays the contents of buffer 1, and Doom draws the next frame into buffer 2.
+
[[Image:Hall of mirrors (glitch).gif|thumb|320px|right|HOM shimmering seen in [[MAP18: The Courtyard (Doom II)|Level 18: The Courtyard]] of [[Doom II]] due to a missing texture.]]
 +
Additionally, a shimmering effect also occurs with the HOM effect. The reason for this is in the Doom engine video system. The Doom engine actually draws into three buffers in a rotating pattern. This is called page flipping. While Doom is rendering into buffer 1 or 3, the video card is displaying the contents of buffer 3 or 2 (so it is not possible to see the screen until rendering has completed). When rendering is complete, it reverses ("flips") the buffers: the video card displays the contents of buffer 1 or 3, and Doom draws the next frame into buffer 2 or 1.
  
Because of this, when there is nothing to draw, the leftover parts of previous frames are displayed. However, because of page flipping, the contents of two previous frames are shown, alternating back and forth. Because there is typically only very slight difference between frames of animation, there is a shimmering effect. Most modern [[source port]]s do not use page flipping, so they lose the shimmering effect.
+
Because of this, when there is nothing to draw, the leftover parts of previous frames are displayed. However, because of page flipping, the contents of two previous frames are shown, alternating back and forth. Because there is typically only very slight difference between frames of animation, there is a shimmering effect. Most newer [[source port]]s do not use page flipping, and thus lose the shimmering effect.
 +
 
 +
== Flat bleeding ==
 +
If HOM would occur on a location of the screen where the game is drawing a floor or ceiling [[flat]] texture, the flat will instead "bleed" across, with the generated [[visplane]]s filling in the otherwise empty area of the screen. The flats of floors or ceilings bleeding across the screen due to the flood fill algorithm can be either an accidental or intentional effect, with some of its intentional uses being different light levels for a sector's floor and ceiling, creating "deep water", or to create an otherworldly effect such as the one exhibited by the water cube above the exit in [[MAP25: Bloodfalls (Doom II)|MAP25 of Doom II]].
  
 
== Deep water effect ==
 
== Deep water effect ==
Certain levels have exploited HOM as a feature; for instance, it can be used to make invisible pits, for a "deep water" effect (as with the easternmost room in [[MAP13: The Crypt]]). The edges of the pit have no [[texture]], so the floor bleeds over the step. If the player dies while in the water, his viewpoint falls below the waterline and the shimmering hall of mirrors effect is visible on the missing texture, similar to being underwater.  However, this procedure can cause problems on modern hardware-accelerated source ports, which do not behave the same as the original software-rendered version of Doom.
+
Certain levels have exploited the HOM as a feature; for instance, it can be used to make invisible pits, for a "deep water" effect (as with the easternmost room in [[MAP13: The Crypt]] of [[Plutonia]]). The edges of the pit have no [[texture]], so the floor bleeds over the step. If the player dies while in the water, his viewpoint falls below the waterline and the shimmering hall of mirrors effect is visible on the missing texture, similar to being underwater.  However, this procedure can cause problems on modern hardware-accelerated source ports, which do not behave the same as the original software-rendered version of Doom.
  
 
== HOM detection ==
 
== HOM detection ==
  
HOM can be a problem for level designers.  Properly designed levels will not have any areas where HOM is visible.  For this reason, many [[level editor]]s include checking facilities to search for locations where textures are not set and HOM is likely to occur.   
+
HOMs can be a problem for level designers.  Properly designed levels will not have any areas where a HOM is visible.  For this reason, many [[level editor]]s include checking facilities to search for locations where textures are not set and HOM is likely to occur.   
 +
 
 +
Team TNT's [[Boom]] modification of the Doom engine includes a special feature to assist in HOM detection: the [[Source port cheat codes|cheat code]] "TNTHOM" enables it.  When enabled, the screen is cleared before rendering.  The clear color alternates between black and red, giving a "flashing red light" effect where a HOM exists.
  
TeamTNT's [[Boom]] port included a special feature to assist in HOM detection: the cheat code "TNTHOM" enables it. When enabled, the screen is cleared before rendering.  The clear color alternates between black and red, giving a "flashing red light" effect where HOM exists.
+
== Deliberate use ==
 +
The hall of mirrors effect is occasionally used deliberately as a special effect or for artistic reasons (such as in joke WADs). Some examples of such include various levels by REoL Tough, and [[50 Shades of Graytall]]'s {{maplinkgen|MAP06|Count Trakula's Castle|50 Shades of Graytall}} where they are used to create an artistic, "wavy" effect.
  
 
== Demo files ==
 
== Demo files ==
* [[Media:d218hom.lmp|A small HOM]] ([[:Image:d218hom.lmp|file info]]) on [[MAP18: The Courtyard]]
+
* [[Media:d218hom.lmp|A small HOM]] ([[:Image:d218hom.lmp|file info]]) on [[Level 18: The Courtyard]]
  
 
[[Category:Errors and bugs]]
 
[[Category:Errors and bugs]]
 
[[Category:Doom engine]]
 
[[Category:Doom engine]]

Revision as of 09:33, 13 January 2023

A rendering of the Hall of Mirrors effect

Under the Doom engine, if the no-clipping cheat is used to go outside the level, a shimmering mass is visible in the empty space outside, composed of parts of previous frames of animation. The same effect can be achieved by making a level with a wall which has no texture. This is called the Hall of mirrors effect. The name comes from the fact that it appears somewhat like being in a hall of mirrors. It is sometimes abbreviated HOM or HOM effect.

When the game renders the level to the screen, it draws it into a buffer, an area of memory. During gameplay, the previous contents of the buffer are overwritten by consecutive frames. However, if a player travels outside the level, there are no walls to draw, so Doom draws nothing. Instead, the previous contents of the buffer are displayed, left over from previous frames.

If a player turns around and looks back toward the level, they can see through the walls and inside the level. The floors of the level stretch outwards toward the screen edge in vertical columns. This is because the Doom floor and ceiling drawing system is like a flood fill algorithm: because there are no walls to bound them, they simply "bleed" down to the edges of the screen.

Shimmering effect

HOM shimmering seen in Level 18: The Courtyard of Doom II due to a missing texture.

Additionally, a shimmering effect also occurs with the HOM effect. The reason for this is in the Doom engine video system. The Doom engine actually draws into three buffers in a rotating pattern. This is called page flipping. While Doom is rendering into buffer 1 or 3, the video card is displaying the contents of buffer 3 or 2 (so it is not possible to see the screen until rendering has completed). When rendering is complete, it reverses ("flips") the buffers: the video card displays the contents of buffer 1 or 3, and Doom draws the next frame into buffer 2 or 1.

Because of this, when there is nothing to draw, the leftover parts of previous frames are displayed. However, because of page flipping, the contents of two previous frames are shown, alternating back and forth. Because there is typically only very slight difference between frames of animation, there is a shimmering effect. Most newer source ports do not use page flipping, and thus lose the shimmering effect.

Flat bleeding

If HOM would occur on a location of the screen where the game is drawing a floor or ceiling flat texture, the flat will instead "bleed" across, with the generated visplanes filling in the otherwise empty area of the screen. The flats of floors or ceilings bleeding across the screen due to the flood fill algorithm can be either an accidental or intentional effect, with some of its intentional uses being different light levels for a sector's floor and ceiling, creating "deep water", or to create an otherworldly effect such as the one exhibited by the water cube above the exit in MAP25 of Doom II.

Deep water effect

Certain levels have exploited the HOM as a feature; for instance, it can be used to make invisible pits, for a "deep water" effect (as with the easternmost room in MAP13: The Crypt of Plutonia). The edges of the pit have no texture, so the floor bleeds over the step. If the player dies while in the water, his viewpoint falls below the waterline and the shimmering hall of mirrors effect is visible on the missing texture, similar to being underwater. However, this procedure can cause problems on modern hardware-accelerated source ports, which do not behave the same as the original software-rendered version of Doom.

HOM detection

HOMs can be a problem for level designers. Properly designed levels will not have any areas where a HOM is visible. For this reason, many level editors include checking facilities to search for locations where textures are not set and HOM is likely to occur.

Team TNT's Boom modification of the Doom engine includes a special feature to assist in HOM detection: the cheat code "TNTHOM" enables it. When enabled, the screen is cleared before rendering. The clear color alternates between black and red, giving a "flashing red light" effect where a HOM exists.

Deliberate use

The hall of mirrors effect is occasionally used deliberately as a special effect or for artistic reasons (such as in joke WADs). Some examples of such include various levels by REoL Tough, and 50 Shades of Graytall's MAP06: Count Trakula's Castle where they are used to create an artistic, "wavy" effect.

Demo files