The sky tag, often called a skybox, models the environment outside the BSP. It contains radiosity parameters that affect lightmaps like ambient light and directional lights, defines general atmospheric fog (not to be confused with planar fog), and can have a 3D model that draws behind level geometry.
The sky is not responsible for weather effects, which are instead assigned to clusters in Sapien.
Indoor skies
Even fully indoor levels can use a sky. Sky tags contain both outdoor/exterior and indoor/interior options for ambient light, fog, and directional light. The first sky in the scenario's skies block (sky 0
) has special meaning and its indoor options are used for any indoor clusters the BSP has. A fully indoor level with no visible sky faces will only have indoor clusters.
However, it is not mandatory that indoor levels use a sky. Without any skies in the scenario the space outside the BSP will simply be black and there will be no interior fog or ambient light, as is the case with Chiron TL34. Indoor levels can still be lit using light-emitting shaders in the BSP and objects that affect lightmaps.
Multiple skies
Scenarios can reference up to 8 skies. This is mostly useful for long singleplayer levels where the artist wants to portray a change in weather, time of day, or lighting in a different BSP. This is accomplished by using the +sky0
and +sky1
special material names, for example. Tool will not permit any cluster to have a mix of these special materials.
The scenario should reference a sky in the skies block for each sky index used in special materials. For example, if you used +sky0
, +sky1
, and +sky2
then the skies block should contain 3 sky references. The game and lightmapping process is tolerant if this is not the case, however. Any missing skies block entries or empty/null sky references will simply result in black being seen through those sky faces and those clusters receiving no sky lighting and fog.
When the game changes to a different sky the fog colour will smoothly transition over cumulative camera movement of approximately 20 world units. In other words, the fog doesn't change if the camera isn't moving and it needs to move about 20 units (even back and forth) to fully transition. The model itself does not transition in any way and changes instantly. Transitions can happen as the camera/player moves between clusters with different skies, between indoor and outdoor clusters, or during a BSP switch. An example of the latter can be seen in Assault on the Control Room when the player reaches the first chasm and Cortana says "the weather patterns here seem natural"; look up and you should see the fog transition as you move.
Animation
The model of a skybox can be rigged and animated with an overlay (JMO) model_
You can also animate the sky's shaders for things like sliding cloud textures or a twinkling star effect.
Related debug globals
The following are related debug globals that you can enter into the developer console for troubleshooting.
Global | |
---|---|
Toggles both environmental sky fog and fog plane colors. Does not affect fog screen. Use | |
Toggles atmospheric fog as defined in the active sky tag. | |
Toggles the lens flare "god rays" effect, present on sky lights or lens flares explicitly set to sun. |
Structure and fields
Field | Type | Comments | |||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
model | An optional reference to a model which is rendered for this sky. Fully indoor maps where the sky isn't visible don't need to have a model since there would be no way to see it (and it doesn't render from indoor clusters anyway). | ||||||||||||||||||||||||||||||||||||||||||||||||||||
animation graph | TagDependency : model_animations | An animation which can move parts of the sky model, including markers. This must be an overlay (JMO) animation to work. | |||||||||||||||||||||||||||||||||||||||||||||||||||
indoor ambient radiosity color | ColorRGB | Sets the colour used for ambient light in indoor clusters. This can be used to brighten indoor spaces to a minimum level. | |||||||||||||||||||||||||||||||||||||||||||||||||||
indoor ambient radiosity power | float | Sets the strength of indoor ambient light. This value must not be negative (causes a crash in pre-H1A versions). | |||||||||||||||||||||||||||||||||||||||||||||||||||
outdoor ambient radiosity color | ColorRGB | Sets the colour used for ambient light in outdoor clusters. It is like a fill light that approximates light coming from all directions and will be most visible in shadowed areas that would not be lit otherwise. This is typically a similar colour to the sky's backdrop, e.g. blue for a blue sky and black in space. | |||||||||||||||||||||||||||||||||||||||||||||||||||
outdoor ambient radiosity power | float | Sets the strength of outdoor ambient light. Values around | |||||||||||||||||||||||||||||||||||||||||||||||||||
outdoor fog color | ColorRGB | The colour of the atmospheric fog which draws over the BSP by distance while in outdoor clusters. | |||||||||||||||||||||||||||||||||||||||||||||||||||
outdoor fog maximum density | float | Limits the maximum density of outdoor fog. For example, a value of | |||||||||||||||||||||||||||||||||||||||||||||||||||
outdoor fog start distance | float | Within this distance there will be no outdoor fog drawn. This is the start distance where fog begins to fade to its maximum density. A small value like | |||||||||||||||||||||||||||||||||||||||||||||||||||
outdoor fog opaque distance | float | The distance where fog reaches its maximum density. Note that the outdoor_ | |||||||||||||||||||||||||||||||||||||||||||||||||||
indoor fog color | ColorRGB | The colour of the atmospheric fog which draws over the BSP by distance while in indoor clusters. | |||||||||||||||||||||||||||||||||||||||||||||||||||
indoor fog maximum density | float | Limits the maximum density of indoor fog. If this value is | |||||||||||||||||||||||||||||||||||||||||||||||||||
indoor fog start distance | float | Within this distance there will be no indoor fog drawn. This is the start distance where fog begins to fade to its maximum density. A small value like | |||||||||||||||||||||||||||||||||||||||||||||||||||
indoor fog opaque distance | float | The distance where fog reaches its maximum opacity for indoor clusters. When indoor fog maximum density is | |||||||||||||||||||||||||||||||||||||||||||||||||||
indoor fog screen | TagDependency : fog | This field is seemingly unused but was probably intended to allow indoor clusters to have a fog screen effect like planar fog. Setting a reference here does not cause anything to render even in H1A where fog screen effects were fixed for planar fog. | |||||||||||||||||||||||||||||||||||||||||||||||||||
shader functions | Block | Not used by the engine. Ignore this field. | |||||||||||||||||||||||||||||||||||||||||||||||||||
animations | Block | Defines the repeating period (duration) of sky model animations. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
lights | Block | A list of directional light sources that cast light on the level. These are mainly used to represent incoming sunlight, but you can include multiple lights to model different light sources. For example, if you were making a night sky with two moons you could have two lights, or if your sky is cloudy you may wish to have a direct overhead light with a high diameter and low power to model soft lighting bounced down from the clouds. A sky doesn't have to have any lights. Indoor skies like the one for The Library have no need unless you have a special reason to force directional lights indoors with the affects interiors flag. | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
Acknowledgements
Thanks to the following individuals for their research or contributions to this topic:
- Galap (Researching the purpose of affects interiors)