Skybox

By Richard Clark

Skybox
Figure 1: Skybox in Action

If you have played Unreal than you know how impressive the sky can become when a skybox is used. The ZDoom skybox is similar to the Unreal type of skybox and is quite impressive. Figure 1 illustrates a sample skybox. Although it is a bit hard to see in the picture, the sky has both a foreground and background mountain range that makes the scene very three dimensional.

Not only does a skybox look great, it is quite easy to make as well. The sample wad, skybox.wad illustrates the use of the skybox.

Figure 2 shows a typical setup.

Map Layout
Figure 2: Map Layout

In Figure 2, the first mountain range is a Hexen sky texture that has a transparent top portion. This allows the texture on the walls of the skybox sector to show through, giving a nice 3D effect.

The skybox itself is a hidden sector that has a Skybox thing (9080). The position and facing of the Skybox thing will be the position of the sky in the playable sector. The Skybox thing takes one parameter that specifies the visibility of the skybox.

Skybox visibility is controlled independently of the rest of the map (which is controlled by the cvar r_visibility). The visibility used for this thing is four times the corresponding value of r_visibility. So to use the standard visibility of 8, set the first argument to 32.

Leave the 9080 thing's TID as 0 to make it the default sky for the level. If you give it a non-zero TID, then you also need to use a 9081 thing in any sectors that you want to use that skybox. The 9081 thing's first argument should match the TID of the desired 9080 thing. This allows a single level to have multiple skies.

If you use a 9081 thing with a first argument of 0, then its sector will use the standard sky texture instead of a skybox, even if you set a default skybox for the map.

If you have noisy things inside the skybox (such as projectiles), you can place a 9082 in the skybox's sectors to prevent things from making noise.

Sources

ZDoom reference by Randy Heit.

Back