env_sky

XashXT

env_sky

Fakes detailed environments by projecting actual in-game objects on a SKY texture with configurable scale settings.

Spawnflag

SF_ENVSKY_START_OFF 1 (skybox initially turned off)

Options

fov Sky field-of-view angle. Changing the value distorts the projection.
scale Scale relative to the game level. If left blank, causes the sky to act like a painted skybox.

Usage Details

  • To create a 3D skybox, use a separate enclosed area. The contents of this area will be projected onto the map's main boundaries covered with the “sky” texture. Using the “sky” texture in the skybox is discouraged, even though it should not cause any problems. If you encounter skybox entities at their original scale “peeking” through the sky texture, try moving the skybox elsewhere so it is not in the line of sight from anywhere in the map. For example, place it below the bottom of the level or use the trick from the demo_1 map.
  • The 3D skybox is projected onto a regular SKY texture, unlike Spirit of Half-Life, where a NULL texture or, in later versions, a 3DSKY texture was required.
  • In theory, you can attach the entity using the parent system to create interesting effects. However, in practice its motion should take into account the scale of the skybox relative to the level—this means the motions should be slight.
  • The default scale (scale 1) is taken to be 1/100. That is, the sky is 100 times bigger than the level; at a scale of 1.5 it is 150 bigger, at a scale of 0.8 80 times bigger and so on. Note that when scaling is used, the level's total size takes into account the size and position of the skybox (which can affect the level size). The scale can change as a result, and this can throw off the alignment of the world borders with the skybox borders. Therefore, make sure you set up the skybox no sooner than the map is completed. Otherwise, you will need to repeatedly adjust the scale as you go along.
  • Since version 0.62, you can turn skyboxes off. This allows you to have multiple skyboxes and substitute them; for example, you can simulate a day and night cycle this way.
    Note: If multiple skyboxes are turned on at once, then only the one listed first in the entity list will be drawn.

Limitations

  • Using fog, mirrors and portals inside a skybox is not recommended. Skybox behaviour has never been tested in such situations, and the result is undefined. However, the skybox itself is reflected in mirrors and visible in portals and monitors.