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.

The effect is not particularly complicated. The "melting" screen is subdivided into vertical slices, two pixels wide. Each slice moves down the screen at a uniform speed, but they do not all begin moving at the same time, each slice given a random yet short delay.

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 GL source ports. As a result, most GL ports do not implement the screen melt effect; however, some (such as PrBoom plus and EDGE) now do.

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.