Skybox (video games)
From Wikipedia, the free encyclopedia
This article needs additional citations for verification. Please help improve this article by adding reliable references. Unsourced material may be challenged and removed. (August 2007) |
A skybox is a method to easily create a background to make a computer and video games level look bigger than it really is. The level is enclosed in a cube; the sky, distant mountains, distant buildings, and other unreachable objects are displayed on the cube's faces, thus creating the illusion of distant three-dimensional surroundings. A skydome employs the same concept but uses either a sphere or a hemisphere instead of a cube.
Processing of 3D graphics is computationally expensive, 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 3D world around it, made up of those 6 faces.
As a viewer moves through a 3D 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 displaced 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 3D 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).
[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 appeared to be infinitely distant, even if they were close-by. Starting in the late 1990s, 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.
Newer 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. It is also possible, but not required, to include 3D geometry which will surround the accessible playing environment, such as unreachable buildings or mountains. They are designed and rendered at 1/16 scale, and then resized to appear much larger, whilst using much less CPU power. This effect is called "3D skybox".
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 closing chapters of the game, the player travels 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. As the player reaches the base of the Citadel, it is broken into two pieces. A small lower section is a part of the main map, while the upper section is in the 3D skybox. The two sections are seamlessly blended together to appear as a single structure.