
A skybox is a method of creating backgrounds to make a
video game
A video game or computer game is an electronic game that involves interaction with a user interface or input device (such as a joystick, game controller, controller, computer keyboard, keyboard, or motion sensing device) to generate visual fe ...
level
Level or levels may refer to:
Engineering
*Level (optical instrument), a device used to measure true horizontal or relative heights
* Spirit level or bubble level, an instrument designed to indicate whether a surface is horizontal or vertical
*C ...
appear larger than it really is. When a skybox is used, the level is enclosed in a
cuboid
In geometry, a cuboid is a hexahedron with quadrilateral faces, meaning it is a polyhedron with six Face (geometry), faces; it has eight Vertex (geometry), vertices and twelve Edge (geometry), edges. A ''rectangular cuboid'' (sometimes also calle ...
. The
sky
The sky is an unobstructed view upward from the planetary surface, surface of the Earth. It includes the atmosphere of Earth, atmosphere and outer space. It may also be considered a place between the ground and outer space, thus distinct from ...
, 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
A sphere (from Ancient Greek, Greek , ) is a surface (mathematics), surface analogous to the circle, a curve. In solid geometry, a sphere is the Locus (mathematics), set of points that are all at the same distance from a given point in three ...
or a
hemisphere
Hemisphere may refer to:
In geometry
* Hemisphere (geometry), a half of a sphere
As half of Earth or any spherical astronomical object
* A hemisphere of Earth
** Northern Hemisphere
** Southern Hemisphere
** Eastern Hemisphere
** Western Hemi ...
instead of a cube.
Processing of
3D graphics
3D computer graphics, sometimes called CGI, 3D-CGI or three-dimensional computer graphics, are graphics that use a three-dimensional representation of geometric data (often Cartesian) that is stored in the computer for the purposes of perfor ...
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
Parallax is a displacement or difference in the apparent position of an object viewed along two different sightline, lines of sight and is measured by the angle or half-angle of inclination between those two lines. Due to perspective (graphica ...
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
Texture may refer to:
Science and technology
* Image texture, the spatial arrangement of color or intensities in an image
* Surface texture, the smoothness, roughness, or bumpiness of the surface of an object
* Texture (roads), road surface c ...
, 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).
Advanced skyboxes
Simple texture-based skyboxes had severe disadvantages. They could not be animated, and all objects would appear equally distant at infinity. They looked simple and because of certain limits, it was hard for designers to be creative with this feature. But 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 touching the skybox.
In older versions of this technology, such as the ones 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 color 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 so. 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 modeled at a smaller scale, typically 1/16th, then rendered by the engine to appear much larger. This results in fewer CPU requirements than if they were rendered in full size. The effect is referred to as a "3D skybox".
In the game ''
Half-Life 2
''Half-Life 2'' is a 2004 first-person shooter game developed and published by Valve Corporation. It was published for Windows on Valve's digital distribution service, Steam. Like the original ''Half-Life'' (1998), ''Half-Life 2'' is played ent ...
'', this effect was extensively used in showing
The Citadel, a huge structure in the center 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.
See also
*
Cube mapping
*
Parallax scrolling
External links
Skybox (2D)(Valve Developer Community)
(Tutorial 25: SkyBox)
References
{{Computer graphics
Video game design