Sky

The sky is a special effect built into the Doom rendering engine.

The original Doom contains three sky textures (SKY1, SKY2 and SKY3), one for each episode. This is consistent with the backstory, because each episode takes place in a specific venue (Phobos, Deimos and Hell, respectively), and the nine levels of each episode share the same sky.

Doom II uses the same names for its three sky textures, but the graphics in the IWAD file are different. The engine selects SKY1 for the levels MAP01 through MAP11, SKY2 for MAP12 through MAP20, and SKY3 for MAP21 through MAP32. The game is not divided into episodes, of course, but textual interludes divide it into related groups of levels and the sky textures again correspond to the backstory venues: starport, your own home city and alien base (Hell on Earth).

Ultimate Doom added a fourth sky texture, SKY4, for use in Episode 4.

TNT: Evilution uses an interesting variation: SKY1 is daytime and SKY2 is nighttime. However, SKY3 is yet another rendering of the Hell sky.

Technical
In order to appear out-of-doors, a sector is given the special ceiling flat name of F_SKY1. This flat is not actually drawn, however. The engine recognizes it as indicating that the ceiling is transparent to the sky beyond, and draws sky above the ceiling height. The actual sky texture drawn depends on the episode and/or level number as described above. It is important to note that the sky is drawn similarly to a wall, not like a regular ceiling.

SKY1, SKY2, SKY3 and SKY4 are in an IWAD file as wall textures, each consisting of one or more wall patches. Like all wall textures, they must be 128 units high. They are always drawn with their tops at the top of the view window and their zero column at due north. A 1024-wide sky will exactly circumscribe the horizon. The sky textures in Doom and Doom II are only 256 units wide, so they are tiled and repeat four times for each full revolution.

Additional information

 * F_SKY1 may be used for floors as well as ceilings. However, this may cause Hall of Mirrors effect if the player can see too high.
 * SKY1 et. al. may be used directly as wall textures, but then they just look like paintings. They will be mirror images of what they look like when used as sky.
 * If the player can see too far down (past the bottom of the sky texture), a seam will appear between texture tiles.
 * If two adjacent sectors both have F_SKY1 for their ceiling (or floor), the upper (or lower) texture specified (if any) is ignored. Sky is drawn instead.
 * Animated skies do not work.
 * Sky selection is one reason a PWAD author might select a map slot other than E1M1 or MAP01 (another obvious reason is the music). Of course, with a little more work the author could provide replacement sky or music lumps.