Skybox (video games)

From Wikipedia, the free encyclopedia

The clouds and sky in this Half-Life: Opposing Force screenshot are part of the skybox. Note that the two cloud images are not perfectly aligned, resulting in a visible seam (left of centre near the top).
The clouds and sky in this Half-Life: Opposing Force screenshot are part of the skybox. Note that the two cloud images are not perfectly aligned, resulting in a visible seam (left of centre near the top).

A skybox is a method to easily create a background to make a computer and video games level look bigger than it really is, by creating the illusion of distant three-dimensional surroundings.

Processing of 3D graphics is very costly, specifically in real-time games, and poses multiple limits. Levels have to be processed at tremendous speeds, making it difficult to render vast skyscapes in real-time. Additionally, due to the nature of computer graphics, objects at large distances suffer from floating point errors, causing levels to have strong limits on their extents.

To compensate for these problems, games often employ skyboxes. Traditionally, these are simple cubes with up to 6 different textures placed on the faces. By careful alignment, a viewer in the exact middle of the skybox will perceive the illusion of a real 3-D world around it, made up of those 6 faces.

As a viewer moves through a 3-D scene, it is common for the skybox to remain stationary with respect to the viewer. This technique gives the skybox the illusion of being very far away since other objects in the scene appear to move, while the skybox does not. This imitates real life, where distant objects such as clouds, stars and even mountains appear to be stationary when the viewpoint is displaces by relatively-small distances. Effectively, everything in a skybox will always appear to be infinitely distant from the viewer. This consequence of skyboxes dictates that designers should be careful not to carelessly include images of discrete objects in the textures of a skybox since the viewer may be able to perceive the inconsistencies of those objects' sizes as the scene is traversed.

The source of a skybox can be any form of texture including photographs, hand-drawn images, or pre-rendered 3-D geometry. Usually, these textures are created and aligned in 6 directions, with viewing angles of 90 degrees (which covers up the 6 faces of the cube).

A skydome employs the same concept but uses either a sphere or a hemisphere instead of a cube.

[edit] Advanced skyboxes

As technology progressed it became clear the default skybox had severe disadvantages. It could not be animated and all objects in it appear to be infinitely distant, even if they are objects close-by. Starting in the late 1990's, some game designers built small amounts of 3D geometry to appear in the skybox to create a better illusion of depth, in addition to a traditional skybox for objects very far away. This constructed skybox was placed in an unreachable location, typically outside the bounds of the playable portion of the level, to prevent players from entering the skybox.

In older versions of this technology, such as presented in the game Unreal this was limited to movements in the sky, such as the movements of clouds. Elements could be changed from level to level, such as the positions of stellar objects, or the colour of the sky, giving the illusion of the gradual change from day to night. The skybox in this game would still appear to be infinitely far away, as the skybox, although containing 3D geometry, did not move the viewing point along with the player movement through the level.

More advanced engines, such as the Source engine, continue on this idea, allowing the skybox to move along with the player, although at a different speed. Because depth is perceived on the compared movement of objects, making the skybox move slower than the level causes the skybox to appear far away, but not infinitely. In this version, the skybox actually is constructed almost as a miniature next to the main level, complete with its own skybox to maintain the illusion of an infinitely far sky. This miniature is often at a scale (the Source engine typically uses 1/16th) to compensate for the floating point errors.

In the game Half-Life 2 this effect was extensively used in showing The Citadel, a huge structure in the centre of City 17. In the later half of the game, the player would eventually travel through the city towards the Citadel, the skybox effect making it grow larger and larger progressively with the player movement, completely appearing to be a part of the level. In some instances, the Citadel is broken into 2 pieces. A small lower section is a part of the main map, while the upper section is in the skybox. The two sections are seamlessly blended together to appear as a single structure.

In other languages