This article's documentation is for anything that uses the Source engine. Click here for more information.

Sky camera: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(65 intermediate revisions by 32 users not shown)
Line 1: Line 1:
[http://www.calvarymaricopa.org/blog/wp-content/uploads/2007/10/entrda.html night time is the right time cosby] [http://portsmouthrespect.org.uk/files/music/elbocplba.html vendio image hosting] [http://cruelporn.net/whelp/images/ricfireq.html shopping in oxford mississippi] [http://arizonaparanormalinvestigations.com/api_gallery/albums/userpics/10013/quaplbr.html mind boggling games supplier] [http://osbc.co.uk/xinstallation/sql/images/dronortro.html american express accountsummary] [http://cobra-web.nl/shop/images/thumbs/mexfevf.html mimosa park palma] [http://arizonabass.info/forums/photogallery/data/505/medium/thumbs/zarquae.html teach a man to fish quote] [http://apple4you.nl/images/apple_hardware/macbook/thumbnails/pics/koneget.html alpha computer consultants] [http://poppycede.com/wp-content/uploads/blogger/blogger/5998/447/golachen.html reinstalling outlook express windows 98] [http://portsmouthrespect.org.uk/files/music/alraccnao.html kid libertys lyric song theme] [http://unis-libdems.co.uk/forum/cache/files/nerogold.html quimsa cruz] [http://jlbworks.com/ssp-director-salama/albums/album-1/director/class_1/racfal.html listener professional] [http://popcop.co.uk/phpBB3/images/avatars/gallery/icons/bolica.html 2003a download icq] [http://www.phuket.as/gallery/data/563/medium/pics/latroc.html tenderly he watches over you] [http://eproperty.lk/uploadfiles/upload/bocbrwl.html university california berkeley] [http://unis-libdems.co.uk/forum/cache/files/chizarsit.html yellow and white flowers] [http://woodrowwildcats.org/wiki/img/trackers/icons/nrelto.html new york architecture building] [http://apple4you.nl/images/apple_hardware/macbook/thumbnails/pics/trocelt.html rickenbacker pickups] [http://cuillinfm.co.uk/phpBB/images/avatars/pics/etrelnor.html rollin video] [http://eproperty.lk/uploadfiles/upload/recdedr.html opml reader windows] [http://osbc.co.uk/xinstallation/sql/images/vifure.html art prints of caribbean beaches for sale] [http://woodrowwildcats.org/wiki/img/trackers/icons/larolol.html alberghi gimignano san] [http://avintageaffair.org/ssp-director/albums/album-1/tn/pics/fac4tplgo.html lyrics to pussycat dolls stick with you] [http://jlbworks.com/ssp-director-salama/albums/album-1/director/class_1/nodelsitn.html pourquoi on dort] [http://cobra-web.nl/shop/images/thumbs/ricetreco.html wall mural pattern] [http://popcop.co.uk/phpBB3/images/avatars/gallery/icons/hensitb.html american airlines customer relations phone number] [http://portsmouthrespect.org.uk/files/music/darrexri.html piezo systems inc.] [http://arizonaparanormalinvestigations.com/api_gallery/albums/userpics/10013/cpasacel.html pier one impots] [http://seismicss.com/forms/temp/thumbs/pasbrnede.html shaker armoires] [http://deerhurst.com/eshop/images/thumbs/lolialfa.html without a song composer] [http://osbc.co.uk/xinstallation/sql/images/chidron.html time period of shakespeare] [http://highland-cruise.com/2007buildTENP/forum/z/user/blocks/icons/domchen.html yancy spencer] [http://jefflane.org/dl/files/cache/eltplcal.html wedding gallerys] [http://poppycede.com/wp-content/uploads/blogger/blogger/5998/447/fimonp.html lyrics for i melt by rascal flats] [http://www.reubenbutchart.com/dada_files/fans/archives/1187721333/20070821133530/indaretg.html lowest point on earth] [http://cobra-web.nl/shop/images/thumbs/trgeto.html animation gif photo shop] [http://lifestyletoolbox.com/admin/sales/snapshop/golacs.html wi state map] [http://unis-libdems.co.uk/forum/cache/files/lazalquaf.html last minute flight deal cheap last minute flights bikini] [http://apple4you.nl/images/apple_hardware/macbook/thumbnails/pics/lasitb.html architecture baroque] [http://avintageaffair.org/ssp-director/albums/album-1/tn/pics/plccnaq.html anti antibody muscle smooth] [http://www.reubenbutchart.com/dada_files/fans/archives/1187721333/20070821133530/sadelza.html eva cassidy guitar tab] [http://dundeecruise.com/forum/pafiledb/cache/templates/fiblack3dblue/pa_main/fevlet.html wholesale retro fabric] [http://portsmouthrespect.org.uk/files/music/xkoord.html westchester airport address] [http://lifestyletoolbox.com/admin/sales/snapshop/getalric.html amana refrigerator doors] [http://woodrowwildcats.org/wiki/img/trackers/icons/koracbas.html nature materials abbreviation] [http://dys.gr/f/images/avatars/gallery/thumbs/golchi.html immigration service new zealand] [http://cuillinfm.co.uk/phpBB/images/avatars/pics/mexolo.html smc 7004vwbr router] [http://www.reubenbutchart.com/dada_files/fans/archives/1187721333/20070821133530/wplviq.html river road apartments baton rouge] [http://askshow.com/src/image/bosatr.html 06 ea rugby] [http://deerhurst.com/eshop/images/thumbs/sacage.html journal of micromechanics microengineering] [http://woodrowwildcats.org/wiki/img/trackers/icons/ellicna.html jasper engine exchange] [http://apple4you.nl/images/apple_hardware/macbook/thumbnails/pics/bugzgettr.html traduttore google] [http://cruelporn.net/whelp/images/orrebr.html sistemic] [http://seismicss.com/forms/temp/thumbs/cafubon.html virginia electric power co.] [http://unis-libdems.co.uk/forum/cache/files/sitvarfe.html manipulating strings in vba] [http://askshow.com/src/image/hengetk.html 10 20 cg] [http://www.phuket.as/gallery/data/563/medium/pics/sitfavar.html plastic storage trunks] [http://dys.gr/f/images/avatars/gallery/thumbs/quaetme.html astridge university] [http://apple4you.nl/images/apple_hardware/macbook/thumbnails/pics/fevbrca.html weigh watchers diet] [http://askshow.com/src/image/refilaric.html portland max schedule] [http://dys.gr/f/images/avatars/gallery/thumbs/plneetro.html que curioso] [http://dundeecruise.com/forum/pafiledb/cache/templates/fiblack3dblue/pa_main/getropa.html area code 418 usa] [http://unis-libdems.co.uk/forum/cache/files/ouracric.html air ambulance of america] [http://woodrowwildcats.org/wiki/img/trackers/icons/liqasxfu.html yucay peru] [http://www.reubenbutchart.com/dada_files/fans/archives/1187721333/20070821133530/monelto.html neutering your dog] [http://highland-cruise.com/2007buildTENP/forum/z/user/blocks/icons/nrrolbod.html physical chemistry lab report] [http://cruelporn.net/whelp/images/fuletorac.html entertainment spotlight ctv] [http://cobra-web.nl/shop/images/thumbs/sitcobr.html route maps uk] [http://cobra-web.nl/shop/images/thumbs/ormexxa.html argentinian exports] [http://cruelporn.net/whelp/images/reinc4ter.html antis michele] [http://cruelporn.net/whelp/images/lichic.html recipe for chile rellenos casserole] [http://winexpression.com/test/pictures/cats/thumbs/zplenerp.html schlitze] [http://askshow.com/src/image/sedsano.html solve transshipment schedule] [http://9dot95.com/uploaded/cache/corp/qassit.html iceman otzi] [http://apple4you.nl/images/apple_hardware/macbook/thumbnails/pics/cochis.html thai dishes culver city] [http://9dot95.com/uploaded/cache/corp/golmexq.html window driver updates] [http://www.calvarymaricopa.org/blog/wp-content/uploads/2007/10/chikog.html eduardo capetillo lyrics] [http://popcop.co.uk/phpBB3/images/avatars/gallery/icons/letoouba.html motor vehicle license bureau htm] [http://arizonabass.info/forums/photogallery/data/505/medium/thumbs/brficnadr.html morgans computers manchester] [http://hopelit.com/forms/temp/pics/deqascnat.html louisiana public criminal record] [http://dys.gr/f/images/avatars/gallery/thumbs/dompaspl.html 1942 by island japan occupied] [http://dys.gr/f/images/avatars/gallery/thumbs/fafabocge.html kress retired] [http://poppycede.com/wp-content/uploads/blogger/blogger/5998/447/sedhent.html llewellin setter association] [http://portsmouthrespect.org.uk/files/music/getric.html princess 77 sod] [http://lifestyletoolbox.com/admin/sales/snapshop/zrolkodro.html lasik surgery and atlanta] [http://apple4you.nl/images/apple_hardware/macbook/thumbnails/pics/sadelsedg.html magic tube scarf to knit] [http://cuillinfm.co.uk/phpBB/images/avatars/pics/delbololo.html vagina monologe] [http://dundeecruise.com/forum/pafiledb/cache/templates/fiblack3dblue/pa_main/getindron.html scrippts research institute] [http://poppycede.com/wp-content/uploads/blogger/blogger/5998/447/wbugdele.html judy ken mudgee] [http://eproperty.lk/uploadfiles/upload/koalzel.html sirenis cocotal beach resort casino] [http://portsmouthrespect.org.uk/files/music/albassafa.html raspberry tea and pregnancy] [http://seismicss.com/forms/temp/thumbs/nofokw.html vakantiehuizen nederland] [http://jlbworks.com/ssp-director-salama/albums/album-1/director/class_1/xeltvi.html rk computer furniture] [http://jlbworks.com/ssp-director-salama/albums/album-1/director/class_1/trvareltf.html paul reardon] [http://jlbworks.com/ssp-director-salama/albums/album-1/director/class_1/aldelre.html outreach association pa] [http://popcop.co.uk/phpBB3/images/avatars/gallery/icons/vielgetqa.html rambus hynix trial] [http://highland-cruise.com/2007buildTENP/forum/z/user/blocks/icons/ouzartrnr.html occupational schools] [http://woodrowwildcats.org/wiki/img/trackers/icons/boelxseds.html tarrant county community college employment] [http://lifestyletoolbox.com/admin/sales/snapshop/varcmo.html adult prams sized] [http://cobra-web.nl/shop/images/thumbs/letobr.html administration alaska business small]
{{LanguageBar}}
{{wrongtitle|title=sky_camera}}
{{TabsBar|main=s2|base=sky_camera}}
{{Preserved entity}}
{{CD|CSkyCamera|file1=SkyCamera.cpp}}
{{This is a|semi-internal=1|point entity|name=sky_camera|sprite=1}} 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 <code>sky_camera</code>.


== Entity description ==
When the map is compiled, the areas containing <code>sky_camera</code>(s) are skipped during vis calculations. This can be overridden by <code>-forceskyvis</code> on [[VBSP]].
[[Image:{{PAGENAME}}.png|left]]This entity marks the origin of the map for the [[3D Skybox]]. As your position changes relative to the maps origin it will be scaled and applied relative to the '''sky_camera'''.{{clr}}
 
By default, only one <code>sky_camera</code> may be active at a time and it cannot move.
{{tip|
* 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 [https://tf2maps.net/downloads/change-sky_camera-script.15872/ here]
* In games without VScript, this [https://tf2maps.net/threads/multiple-3d-skyboxes.35829 workaround] can be used instead for multiple or moving skyboxes.
* Duplicate your main [[env_fog_controller]] and then turn that into a <code>sky_camera</code> so that the fog settings will be carried over.}}
{{note|Fog values on <code>sky_camera</code> cannot be changed through inputs (unlike {{ent|env_fog_controller}}) and the max density keyvalue is missing from the FGD by default.{{confirm|It may be possible to [[AddOutput]] the fog keyvalues.}} }}
{{ModernCodenote|There is some leftover code for multiple <code>sky_camera</code> 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 [https://github.com/DownFall-Team/DownFall here]. {{Game link|Mapbase}} uses the aforementioned Downfall code and also adds native support for moving (and rotating) skyboxes. Mapbase's repository can be found [https://github.com/mapbase-source/source-sdk-2013 here].}}
{{warning|If the unmodified version of this entity gets removed in the game, then the game will crash. {{todo|Test the modified code for the same issue.}}}}


== Keyvalues ==
== Keyvalues ==
* {{kv angles}}
{{KV|Name|string|intn=targetname|The [[targetname]] that other entities refer to this entity by.|nofgd=1}}
* '''3D Skybox Scale'''
{{KV|3D Skybox scale|integer|intn=scale|This number determines how large objects in your skybox will seem relative to the map.<br>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.}}
: <float> This number determines how large objects in your skybox will seem relative to the map. Take a skybox scale of 16, an object 1 unit high in the skybox will seem to be 16 units high to player
{{KV|Fog Enable|boolean|intn=fogenable|Enable Fog in the Skybox by Default}}
{{KV|Fog Blend|boolean|intn=fogblend|This will enable blending between two fog colors, based on the direction the player is looking. If the player's viewpoint is equal to the ''fogdir'' vector, the fog will be drawn with the secondary color; if facing in the complete opposite direction, the fog will be drawn with the primary color. <br/> 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. <br/> 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'.}}
{{KV|Use Angles for Fog Dir|boolean|intn=use_angles|}}
{{KV|Primary Fog Color|color255|intn=fogcolor|The Primary Color of the Fog in the Skybox}}
{{KV|Secondary Fog Color|color255|intn=fogcolor2|The Secondary Color of the Fog in the Skybox that will be blended to}}
{{KV|Primary Fog Color (HDR Override)|only={{hl2}} 20th|color255|intn=fogcolor_hdr|The Primary Color of the Fog in the Skybox for HDR maps}}
{{KV|Secondary Fog Color (HDR Override)|only={{hl2}} 20th|color255|intn=fogcolor2_hdr|The Secondary Color of the Fog in the Skybox for HDR maps that will be blended to}}
{{KV|Primary Fog Dir|string|intn=fogdir|A vector (given by three space-separated numbers X Y Z) which points from the secondary fog color '''fogcolor2''' towards the primary fog color '''fogcolor'''.}}
{{KV|Fog Start|string|intn=fogstart|How far from the point-of-view the fog should start. Generally, this should be the same setting as your env_fog_controller.}}
{{KV|Fog End|string|intn=fogend|How far from the point-of-view the view should be completely fogged. Generally, this should be the same setting as your env_fog_controller.}}
{{KV|Fog Max Density|float|intn=fogmaxdensity|Fog Max Density [0..1]. Non-FGD in other games except {{gmod|1}}.|nofgd=1|also={{gmod}}}}
{{KV|Use Radial Fog?|only={{hl2}} 20th, {{hls}}, {{tf2branch}}|intn=fogRadial|boolean|Use radial fog instead of planar-based fog. Only in {{hl2|1}} 20th Anniversary Update, {{hls|1}} (which runs on top of HL2 20th Anniversary base), aswell as all games on {{tf2branch|1}} (since Feb 18, 2025 update).</br>Radial fog is always used on {{l4d|1}} onward, and official maps in {{tf2branch}} games always use radial fog.}}
{{KV|Clip 3D sky near plane to world far plane|intn=clip_3D_skybox_near_to_world_far|boolean|only={{l4d2}}}}
{{KV|3D sky near plane offset|intn=clip_3D_skybox_near_to_world_far_offset|float|only={{l4d2}}|Offset for the near clip plane for the 3D sky in world units.  This is only used if the above field is true.  Negative values to pull closer, etc.}}
{{KV|HDR Color Scale|float|intn=HDRColorScale|Float value to multiply fog color by when running in HDR mode.|since={{l4d2}}}}


* '''fogenable'''
== Inputs ==
: {{boolean}}
{{I|ActivateSkybox|Activates targeted sky_camera and disables rest.|since=L4D2|nofgd=1}} {{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.}}
* '''fogblend'''
: {{boolean}} This will enable blending between two fog colors, based on the direction the player is looking. If the player's viewpoint is equal to the ''fogdir'' vector, the fog will be drawn with the secondary color; if facing in the complete opposite direction, the fog will be drawn with the primary color.
: 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'''
* '''fogcolor'''
: {{color}}
* '''fogcolor2'''
: {{color}}
* '''fogdir'''
: <vector> A vector (given by three space-separated numbers X Y Z) which points from the secondary fog color '''fogcolor2''' towards the primary fog color '''fogcolor'''.
* '''fogstart'''
: <float> How far from the point-of-view the fog should start.
* '''fogend'''
: <float> How far from the point-of-view the view should be completely fogged.


== See also ==
== See also ==
* [[Skybox Basics]] - An overview article on skybox creation.
* [[3D Skybox]]
* [[3D Skybox]]
* [[Skybox Basics]] - an overview article on skybox creation.


[[Category:Entities]]
[[Category:Skybox]]
[[Category: skybox]]

Latest revision as of 14:34, 6 September 2025

English (en)中文 (zh)Translate (Translate)
Recycle-warning.png
This is a preserved entity in Counter-Strike: SourceHalf-Life 2: DeathmatchDay of Defeat: SourceTeam Fortress 2Left 4 DeadLeft 4 Dead 2Portal 2Counter-Strike: Global Offensive
If the game has round restart mechanics this entity may not behave as expected.
C++ Class hierarchy
CSkyCamera
CLogicalEntity
CServerOnlyEntity
CBaseEntity
C++ SkyCamera.cpp
Sky camera.png

sky_camera is a semi-internal point entity available in all Source 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.

Tip.pngTip:
  • 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_camera so that the fog settings will be carried over.
Note.pngNote:Fog values on sky_camera cannot be changed through inputs (unlike env_fog_controller) and the max density keyvalue is missing from the FGD by default.
Confirm:It may be possible to AddOutput the fog keyvalues.
Cpp.pngCode:There is some leftover code for multiple 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 Mapbase uses the aforementioned Downfall code and also adds native support for moving (and rotating) skyboxes. Mapbase's repository can be found here.
Warning.pngWarning:If the unmodified version of this entity gets removed in the game, then the game will crash.
Todo: Test the modified code for the same issue.

Keyvalues

Name (targetname) <string> !FGD
The targetname that other entities refer to this entity by.
3D Skybox scale (scale) <integer>
This number determines how large objects in your skybox will seem relative to the map.
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>
Enable Fog in the Skybox by Default
Fog Blend (fogblend) <boolean>
This will enable blending between two fog colors, based on the direction the player is looking. If the player's viewpoint is equal to the fogdir vector, the fog will be drawn with the secondary color; if facing in the complete opposite direction, the fog will be drawn with the primary color.
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>
The Primary Color of the Fog in the Skybox
Secondary Fog Color (fogcolor2) <color255>
The Secondary Color of the Fog in the Skybox that will be blended to
Primary Fog Color (HDR Override) (fogcolor_hdr) <color255> (only in Half-Life 2 20th)
The Primary Color of the Fog in the Skybox for HDR maps
Secondary Fog Color (HDR Override) (fogcolor2_hdr) <color255> (only in Half-Life 2 20th)
The Secondary Color of the Fog in the Skybox for HDR maps that will be blended to
Primary Fog Dir (fogdir) <string>
A vector (given by three space-separated numbers X Y Z) which points from the secondary fog color fogcolor2 towards the primary fog color fogcolor.
Fog Start (fogstart) <string>
How far from the point-of-view the fog should start. Generally, this should be the same setting as your env_fog_controller.
Fog End (fogend) <string>
How far from the point-of-view the view should be completely fogged. Generally, this should be the same setting as your env_fog_controller.
Fog Max Density (fogmaxdensity) <float> (also in Garry's Mod) !FGD
Fog Max Density [0..1]. Non-FGD in other games except Garry's Mod.
Use Radial Fog? (fogRadial) <boolean> (only in Half-Life 2 20th, Half-Life: Source, Team Fortress 2 branch)
Use radial fog instead of planar-based fog. Only in Half-Life 2 20th Anniversary Update, Half-Life: Source (which runs on top of HL2 20th Anniversary base), aswell as all games on Team Fortress 2 branch (since Feb 18, 2025 update).
Radial fog is always used on Left 4 Dead onward, and official maps in Team Fortress 2 branch games always use radial fog.
Clip 3D sky near plane to world far plane (clip_3D_skybox_near_to_world_far) <boolean> (only in Left 4 Dead 2)
3D sky near plane offset (clip_3D_skybox_near_to_world_far_offset) <float> (only in Left 4 Dead 2)
Offset for the near clip plane for the 3D sky in world units. This is only used if the above field is true. Negative values to pull closer, etc.
HDR Color Scale (HDRColorScale) <float> (in all games since Left 4 Dead 2)
Float value to multiply fog color by when running in HDR mode.

Inputs

ActivateSkybox  (in all games since Left 4 Dead 2) !FGD
Activates targeted sky_camera and disables rest.
Warning.pngWarning: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.

See also