Hall of mirrors effect

From TheAlmightyGuru
Jump to: navigation, search
A hall of mirrors effect in Doom.

The hall of mirrors effect (HOM) is a visual aberration which occurs when an area of the display isn't rendered in a 3D engine, resulting in the previously rendered frame still being visible, an effect viewers have likened to being in a carnival's hall of mirrors.

History

The hall of mirrors effect was popularized in December 1993 by the game Doom. When the no-clipping cheat is activated, the player is able to move outside the normal bounds of map. However, since the Doom engine doesn't render the exterior surface of walls, any part of the view port that doesn't face an internal wall will not be drawn, and the hall of mirrors effect will occur in that area.

The exact appearance of a hall of mirrors effect depends on the rendering process of the program's 3D engine. As more 3D engines were made, different styles of hall of mirrors effects became apparant. For example, in later versions of the Build engine, walls are not rendered when the player is out of bounds, which eliminates the hall of mirrors effect on everything except sprites.

While the hall of mirrors effect is usually only seen while clipping through walls, it is sometimes the result of a map designer forgetting to place a texture on a surface, or a limitation of the rendering engine itself. These are almost always discovered in testing, but they occasionally make it into commercial releases of games. Some clever designers have even purposely used the effect for a desired appearance.

Personal

Shortly after the release of Doom, my friends and I got a copy, and, not long after that, I learned about the no-clipping cheat code allowing me to see the hall of mirrors effect for the first time. It was pretty disorienting at first, and it took me awhile to figure out what was going on.

Technical

Hall of mirrors effect - Diagram.svg

The diagram to the right depicts a 3D environment as viewed from above. The camera points at wall with some breaks in it. Where the camera can see the wall, its surface is rendered for the player to see, but, where there are breaks in the wall, there is nothing for the camera to render. When this happens, it's up to the designer of the 3D engine to determine what to do.

Those 3D engines which are meant to be in a wide open areas, like outdoor flight simulators, expect the camera to be in an environment where there won't be any objects for the camera to render, but these games do no suffer from the hall of mirrors effect because they render always render a backdrop, like a skybox, on every frame. This backdrop guarantees that every part of the camera's field of view will render something.

The Doom engine, however, was created under the assumption that the player would always be confined to a walled-in area. Although it does use skyboxes, the Doom engine was optimized to only draw them when they're necessary. When the player clips through the walls, they take the camera into an area where the camera won't see any walls to render, and the lack of a backdrop prevents the engine from updating those parts of the screen. This by itself would result in the unrendered areas displaying as "ghost" images of old frames, but, because the engine alternates between three frame buffers, what is drawn to the screen alternates between three slightly different images resulting in the noticeable flicker. When facing an indoor area from outside the map's bounds, the top or bottom portion of the area may exhibit the hall of mirrors effect, but, when viewing an outdoor area, the skybox will always completely render the top area. These same effects are seen in games built with the Doom engine, like Heretic and Hexen: Beyond Heretic.

Games built with the Build engine, like Duke Nukem 3D, don't normally have the same hall of mirrors effect because the engine doesn't render any walls if the player is outside the bounds of the map. However, you can still see a hall of mirrors effect when a map tries to render both the top and bottom portions of overlapping sectors in the same field of view. This requires custom maps, as it doesn't happen with the regular game maps. However, because sprites are still drawn even when the player it out of bounds, the gun at the bottom of the screen suffers a similar effect.

The hall of mirrors effect must have been too annoying by the time the Quake engine was made, because it draws a dark gray backdrop in every frame to eliminate the effect. However, the GoldSrc engine, which is based on the Quake engine, sees a return of the effect in games which use it, like Half-Life.

Examples

Links