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. The first is a misty gray sky with lumpy greenish mountains, the second is a red overcast sky with brown mountains with light snow, and the third is a much foggier red sky with mountains tinted reddish-black. Ultimate Doom added a fourth sky texture, SKY4, for use in Episode 4, showing orange-tinted clouds with no visible mountains.

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, depicting a brown partly cloudy sky, SKY2 for MAP12 through MAP20, showing a burning cityscape, and SKY3 for MAP21 through MAP32, which somewhat resembles SKY2 from the original Doom but with bright red cave walls behind the mountains, making it clear the player is in a subterranean Hell. 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).

TNT: Evilution uses an interesting variation: SKY1 is daytime, with an ugly brown sky and snowcapped mountains, and SKY2 is nighttime and filled with stars, with a crude galaxy and a rendering of the Hourglass Nebula covering large portions of opposite sides of the sky. However, SKY3 is yet another rendering of the Hell sky, here bright red and overcast, with no visible cave wall. Plutonia uses grayish-white overcast for SKY1, a somber dark red for SKY2, and bright red hell cave wall for SKY3, without any foreground mountains.

Heretic contains three sky textures (SKY1, SKY2 and SKY3), one for each episode. SKY1 contains a dark gray overcast sky with brown mountains, SKY2 a cloudy red sky with gray mountains, and SKY3 a deep blue underwater "sky" with blue mountains and large struts visibly supporting the dome. Episode 4 and the three unused levels of "Episode 6" simply use SKY1, whereas Episode 5 recycles SKY3.

Hexen does skies in a different manner, allowing for two textures to be used at once as well as scrolling textures (Used, for example, in clouds) and thunder and lightning. Skies in Hexen are defined in the MAPINFO lump.

Technical
In order to appear out-of-doors, a sector is given the special ceiling flat name of F_SKY1 (but see below). 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. They must be 128 units high. They are always drawn with their tops at the top of the view window. Their zero column at due east. A 1024-wide sky will exactly circumscribe the horizon, but the original doom engine cannot handle such long textures. The rendering follows the anti-clockwise direction - from east (0px) to north (256px) to west (512px) to south (768px) - therefore the sky texture appears horizontally flipped.

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. The sky patches in Heretic and Hexen are 200-unit tall, but the textures itself are still declared to be only 128-unit tall. The additional height, however, is used and serves to prevent tiling when looking up or down.

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.
 * Hexen uses F_SKY instead of F_SKY1, and Strife uses F_SKY001. All other Doom-engine games use F_SKY1.
 * 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. Some ports try to prevent this by stretching sky textures, or by making them blur to a solid color past their limits.
 * 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 outside of Hexen and certain source ports.
 * 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; or use port-specific features to choose the sky and music.

Trivia

 * The SKY1 texture was made from a photograph of Yangshuo Cavern which was taken by Tom Atwood. The image was on Aris Software's Media Clips.