This article relies largely or entirely on a single source. (January 2017) |
Part of a series on |
Video game graphics |
---|
A skybox is a method of creating backgrounds to make a video game level appear larger than it really is.[1] When a skybox is used, the level is enclosed in a cuboid. The sky, distant mountains, distant buildings, and other unreachable objects are projected onto the cube's faces (using a technique called cube mapping), 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, especially 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, real-time graphics generally have depth buffers with limited bit-depth, which puts a limit on the amount of details that can be rendered at a distance.
To avoid these problems, games often employ skyboxes. Traditionally, these are simple cubes with up to six 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 six 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 creates the illusion that objects in the skybox are infinitely far away, since they do not exhibit any parallax motion, whereas 3D objects closer to the viewer do appear to move. This is often a good approximation of reality, where distant objects such as clouds, stars and even mountains appear to be stationary when the viewpoint is displaced by relatively small distances. However, designers must be careful about which objects they include in a fixed skybox. If an object of known size (e.g. a car) is included in the texture, and is large enough for the viewer to perceive it as close by, the lack of parallax motion may be perceived as unrealistic or confusing.
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).