Skybox Basics: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
No edit summary
 
(59 intermediate revisions by 34 users not shown)
Line 1: Line 1:
The first thing you need to know is that there are two types of skyboxes in the Source Engine. One type of skybox is the "traditional" 2D <i>skybox</i> that consists of a textured cubic map. Think of a giant cube that surrounds the level, and the skybox textures are applied to the inside faces of the cube. That's a 2D skybox. The textures of the 2D skybox usually consist of clouds and the sun, and other distant details. The 2D skybox for a level is set in the Map Properties dialog of Hammer.
{{LanguageBar}}
__NOTOC__
{| style=float:right
| [[File:Toolsskybox.gif|thumb|<tt>toolsskybox</tt> for 2D and 3D skyboxes]]
| [[File:Toolsskybox2d.gif|thumb|<tt>toolsskybox2d</tt> for 2D skyboxes]]
|}
'''Skyboxes''' are solutions intended to make maps look bigger than they are. They are typically used to display the sky, along with distant, unreachable areas and landscapes, such as distant mountains or buildings. Even though it is called a '''sky'''-box, it does not need to represent a sky in the usual sense.


The 3D <i>skybox</i> is a new type of skybox in the Source Engine. The 3D skybox is extra area constructed by the level designer that is outside the bounds of the gameplay portion of the map. Players of the map can never get into the 3D skybox area, and the 3D skybox is designed to make the area around the map seem much larger than it actually is. Maps <i>do not require</i> a 3D skybox to be created it is a purely optional visual addition to the map. See Making 3D Skyboxes for information about how to create a 3D skybox.
There are two types of skyboxes in the Source engine: '''2D Skyboxes''' and '''3D Skyboxes'''. A map can have both.
 
In-game, the player will see any skybox ''through'' any surface textured with <tt>tools/[[Tool textures (Source)#skybox|toolsskybox]]</tt> or <tt>tools/[[Tool textures (Source)#skybox2d|toolsskybox2d]]</tt>. The difference between these is that the former displays both the 2D skybox and the 3D skybox on top, whereas the latter displays only the 2D skybox.
 
To learn how to use skybox brushes in a level, see [[Skybox Optimization]].
{{warning|'''Do not''' get tempted into ''Boxing'' the entire level with a hollow skybox brush. This can drastically increase [[VVIS]] compile times to infinity, and can cause performance issues on lower-end hardware (poor optimization). The only type of map where this is acceptable is if your map is nothing but a bunch of platforms floating in mid-air as seen in [[Xen]] or {{Rc|2}}. A skybox should instead typically only envelope the upper part of the playing field of a map.}}
 
== 2D Skybox ==
[[File:Skybox_editor_comparison.gif|thumb|An animated {{wiki|GIF}} comparing the view in the editor and the view in-game for a '''2D Skybox'''. Its name is <tt>cs_tibet</tt> from CS:GO.]]
{{main|Skybox (2D)}}
2D Skyboxes give the effect of a giant cube surrounding the map, used for applying textures in its interior faces. It is locked to the player's viewpoint, never moving or changing perspective as they move, creating the illusion of distance. These textures usually consist of the ground meeting the sky to the horizon, clouds, and other distant details.
 
The 2D skybox for a level is set in the ''[[worldspawn|Map Properties]]'' dialog of Hammer.
 
The texture name is '''tools/toolsskybox2d'''. You can also use '''tools/toolsskybox''' for a 2D skybox if there is no 3D skybox in place.
{{note|In {{hl2|2}} the default 2D skybox has visible seams. This is not your fault. Select a different one.}}
{{Note|The {{code|toolsskybox2d}} texture has been removed in {{src2|2}}.}}
 
== 3D Skybox ==
{{main|3D Skybox}}
This new addition for skyboxes became available with the {{src|2}} engine. It's not a skybox in the literal sense, but rather is geometry constructed by the level designer, projected outside the bounds of the gameplay area on the map. Maps ''do not require'' a 3D skybox to be created &mdash; it is a purely optional visual addition to the map.
 
There are many in-game assets designed to work in 3D Skyboxes. Search in the Model Viewer Browser for ''skybox'' to find some scaled down models. You may need [[Model Viewer]].
 
The texture name is '''tools/toolsskybox'''.
 
== See also == 
*[[Skybox lighting]]
*[[Skybox Optimization]] - A tutorial on how to optimize a skybox.
*[[light_environment]] - An entity to control the light that skybox textures emit.
*[[env_cascade_light]] - {{csgobranch|only|addtext={{strata}}{{bms}}}}. An entity which produces real-time, accurate lighting from skybox textures.
[[Category:Skybox]]

Latest revision as of 22:06, 13 June 2025

English (en)Español (es)Русский (ru)中文 (zh)Translate (Translate)
toolsskybox for 2D and 3D skyboxes
toolsskybox2d for 2D skyboxes

Skyboxes are solutions intended to make maps look bigger than they are. They are typically used to display the sky, along with distant, unreachable areas and landscapes, such as distant mountains or buildings. Even though it is called a sky-box, it does not need to represent a sky in the usual sense.

There are two types of skyboxes in the Source engine: 2D Skyboxes and 3D Skyboxes. A map can have both.

In-game, the player will see any skybox through any surface textured with tools/toolsskybox or tools/toolsskybox2d. The difference between these is that the former displays both the 2D skybox and the 3D skybox on top, whereas the latter displays only the 2D skybox.

To learn how to use skybox brushes in a level, see Skybox Optimization.

Warning.pngWarning:Do not get tempted into Boxing the entire level with a hollow skybox brush. This can drastically increase VVIS compile times to infinity, and can cause performance issues on lower-end hardware (poor optimization). The only type of map where this is acceptable is if your map is nothing but a bunch of platforms floating in mid-air as seen in Xen or Ricochet Ricochet. A skybox should instead typically only envelope the upper part of the playing field of a map.

2D Skybox

An animated Wikipedia icon GIF comparing the view in the editor and the view in-game for a 2D Skybox. Its name is cs_tibet from CS:GO.
Main article:  Skybox (2D)

2D Skyboxes give the effect of a giant cube surrounding the map, used for applying textures in its interior faces. It is locked to the player's viewpoint, never moving or changing perspective as they move, creating the illusion of distance. These textures usually consist of the ground meeting the sky to the horizon, clouds, and other distant details.

The 2D skybox for a level is set in the Map Properties dialog of Hammer.

The texture name is tools/toolsskybox2d. You can also use tools/toolsskybox for a 2D skybox if there is no 3D skybox in place.

Note.pngNote:In Half-Life 2 Half-Life 2 the default 2D skybox has visible seams. This is not your fault. Select a different one.
Note.pngNote:The toolsskybox2d texture has been removed in Source 2 Source 2.

3D Skybox

Main article:  3D Skybox

This new addition for skyboxes became available with the Source Source engine. It's not a skybox in the literal sense, but rather is geometry constructed by the level designer, projected outside the bounds of the gameplay area on the map. Maps do not require a 3D skybox to be created — it is a purely optional visual addition to the map.

There are many in-game assets designed to work in 3D Skyboxes. Search in the Model Viewer Browser for skybox to find some scaled down models. You may need Model Viewer.

The texture name is tools/toolsskybox.

See also