sky_camera
If the game has round restart mechanics this entity may not behave as expected.
| CSkyCamera |

sky_camera is a semi-internal point entity available in all
Source games. It is used to mark the position of the map's origin inside the 3D Skybox. As your position changes relative to the maps origin it will be scaled and applied relative to the sky_camera.
When the map is compiled, the areas containing sky_camera(s) are skipped during vis calculations. This can be overridden by -forceskyvis on VBSP.
By default, only one sky_camera may be active at a time and it cannot move.
- In games with VScript, you can control 3D skyboxes and their properties (including fog) per-player using netprops. This includes making them move. Example script can be found here
- In games without VScript, this workaround can be used instead for multiple or moving skyboxes.
- Duplicate your main env_fog_controller and then turn that into a
sky_cameraso that the fog settings will be carried over.
sky_camera cannot be changed through inputs (unlike env_fog_controller) and the max density keyvalue is missing from the FGD by default.sky_camera entities which can be restored in mods. Half-Life 2: Downfall has restored this feature and the work involved is open-source. Downfall's repository can be found here. Mapbase uses the aforementioned Downfall code and also adds native support for moving (and rotating) skyboxes. Mapbase's repository can be found here.Keyvalues
3D Skybox scale (scale) <integer>
For example, at a skybox scale of 16, an object 1 unit high in the skybox will seem to be 16 units high to player.
Fog Enable (fogenable) <boolean>
Fog Blend (fogblend) <boolean>
This can be used to approximate the aesthetic effect of diffuse light filtering through the fog, but since the fog effect color is changed for the entire rendered scene, it is best to keep the two colors relatively close to make the blending less obvious.
For example, sunlight with a yaw of 45 degrees and a pitch of -45 degrees could be enhanced using a fogdir of '-1 -1 1', a fogcolor of '120 110 100' and a fogcolor2 of '80 70 60'.
Use Angles for Fog Dir (use_angles) <boolean>
Primary Fog Color (fogcolor) <color255>
Secondary Fog Color (fogcolor2) <color255>
Primary Fog Color (HDR Override) (fogcolor_hdr) <color255> (only in
20th)
Secondary Fog Color (HDR Override) (fogcolor2_hdr) <color255> (only in
20th)
Primary Fog Dir (fogdir) <string>
Fog Start (fogstart) <string>
Fog End (fogend) <string>
Use Radial Fog? (fogRadial) <boolean> (only in
20th,
,
)
Radial fog is always used on Left 4 Dead onward, and official maps in
Clip 3D sky near plane to world far plane (clip_3D_skybox_near_to_world_far) <boolean> (only in
)
3D sky near plane offset (clip_3D_skybox_near_to_world_far_offset) <float> (only in
)
Inputs
- ActivateSkybox (in all games since
) !FGD - Activates targeted sky_camera and disables rest.
Warning:Should your skyboxes have models or brushwork capable of throwing shadows, all shadows of all props from all skyboxes will compile shadows onto your map. Even when the skybox is switched, the shadows on your map will remain.
Workaround:If your skybox geometry cannot have shadows disabled (such as being made out of displacements), use the -noskyboxrecurseVRAD argument, which prevents skybox geometry from shadowing the main level.
See also
- 3D Skybox
- Skybox Basics - an overview article on skybox creation.