Screen melt

The screen melt is an effect seen when Doom changes scene, for example, when starting or exiting a level. The screen appears to "melt" away to the new screen.

Visually, there are two stages to the screen melt effect. At first, parts of the screen begin to melt while others remain at their previous position on-screen. As the effect advances, more of these "static" parts begin to fall away. In the second stage, the entire screen falls away in unison to the bottom of the screen.

Some source ports, such as ZDoom, add alternate effects for screen transitions, such as an effect that "burns" away the old screen, or simply fades the old screen into the new ("crossfade").

Because of the nature of the effect (relying on raster graphics), it is non-trivial to implement in OpenGL source ports. As a result, many OpenGL ports did not implement the screen melt effect; however several do so now, including at least Doom64 EX, Doomsday, EDGE, GLBoom+, and GZDoom.

Technical
The code responsible for the screen melt effect can be found in f_wipe.c, although the code is invoked from d_main.c. A wipe occurs whenever the gamestate variable changes in Doom. This controls what is currently being displayed on the screen (for example, a normal level view, intermission screen or the title screen). The D_Display function which draws the screen detects if this variable has changed. If so, the current contents of the screen buffer are saved before drawing the new screen.

D_Display then draws the new screen which shows the new game state. However, this is not immediately displayed to the user. The melt effect then runs in a loop, moving the old contents of the screen down to reveal the new screen.

The screen is subdivided into "snakes" of texture, one for each column of the screen. The position of each of these differs from its adjacent snakes by up to one pixel. Because of this, although there is a random element to the screen melt, it nonetheless appears connected along its whole length.