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
No edit summary
No edit summary
 
(68 intermediate revisions by 34 users not shown)
Line 1: Line 1:
[http://mollyschippers.w8w.pl/mesh-folding-chair.html mesh folding chair] [http://georgieseaman.ifrance.com/small/japans-landforms.html japans landforms] [http://lulawork.w8w.pl/article/cannonball.html cannonball] [http://desiraeuren.ifrance.com/pages/call-center-technology.html call center technology consultant] [http://betsyharwood.w8w.pl/naza-group-of.html naza group of company] [http://cheryshowman.w8w.pl/blog/film-reel.html film reel] [http://larascheid.ifrance.com/map-of-iowa.html map of iowa] [http://cheryshowman.w8w.pl/blog/geneology-software.html geneology software] [http://beataraasch.ifrance.com/20-80-home-mortgage.html 20 80 home mortgage] [http://georgieseaman.ifrance.com/small/male-to-female.html male to female transsexual personal page] [http://lorettamcglade.w8w.pl/triumph-star.html triumph star wars] [http://chandaspalding.w8w.pl/blog/military-stud.html military stud] [http://larascheid.ifrance.com/lowes-home-improvement.html lowes home improvement] [http://mollyschippers.w8w.pl/pure-igf.html pure igf] [http://tonitasmythe.ifrance.com/small/little-angels.html little angels models] [http://chandaspalding.w8w.pl/blog/vienna-hotels-luxury.html vienna hotels luxury] [http://cheryshowman.w8w.pl/blog/eva-langoria.html eva langoria] [http://marissaalbro.ifrance.com/titantic.html titantic] [http://anamariasavard.w8w.pl/lakeside-mall-michigan.html lakeside mall michigan website] [http://tanyahale.w8w.pl/blog/kaufman-trailers.html kaufman trailers inc.] [http://larascheid.ifrance.com/wakw-radio.html wakw radio] [http://beataraasch.ifrance.com/en-huelva-publicidad.html en huelva publicidad] [http://beataraasch.ifrance.com/pcg-r505jl-sony.html pcg r505jl sony vaio] [http://desiraeuren.ifrance.com/pages/motorcycle-chains.html motorcycle chains] [http://georgieseaman.ifrance.com/small/century-21-realty.html century 21 realty] [http://tanyahale.w8w.pl/blog/pussy-rubbing-pussy.html pussy rubbing pussy] [http://desiraeuren.ifrance.com/pages/inns-for-sale.html inns for sale vermont] [http://lulawork.w8w.pl/article/used-toyota-truck.html used toyota truck part] [http://danimcreynolds.ifrance.com/web/mildew-remover.html mildew remover] [http://anamariasavard.w8w.pl/thebaseballcubecom.html thebaseballcube.com] [http://beataraasch.ifrance.com/south-america.html south america language] [http://danimcreynolds.ifrance.com/web/ludwick-eye-center.html ludwick eye center] [http://lorettamcglade.w8w.pl/maricopa-county.html maricopa county treasurer tax sale] [http://lucillacarreno.ifrance.com/article/yahoo-loginurl.html yahoo login.url] [http://larascheid.ifrance.com/gay-dating.html gay dating] [http://larascheid.ifrance.com/ions-formation.html ions formation] [http://lucillacarreno.ifrance.com/article/royal-canin.html royal canin] [http://lorettamcglade.w8w.pl/mortgage-marketing.html mortgage marketing] [http://guadalupemcquad.ifrance.com/html/oxnard-beach.html oxnard beach] [http://beataraasch.ifrance.com/googles.html googles] [http://lucillacarreno.ifrance.com/article/vitiman-c-lyrics.html vitiman c lyrics] [http://marissaalbro.ifrance.com/atlanta-real-estate.html atlanta real estate agent] [http://desiraeuren.ifrance.com/pages/atom.html atom] [http://larascheid.ifrance.com/mantle-clock-uk.html mantle clock uk] [http://mollyschippers.w8w.pl/nevada-incorporation.html nevada incorporation] [http://ingeborgmace.ifrance.com/130-mortgage.html 130 mortgage] [http://ingeborgmace.ifrance.com/kitchen-furniture.html kitchen furniture office] [http://kerriecrook.w8w.pl/data/needles.html needles] [http://marissaalbro.ifrance.com/motorola-v400.html motorola v400 data cable and software] [http://larascheid.ifrance.com/born-to-make-you.html born to make you happy] [http://anamariasavard.w8w.pl/eastside-catholic.html eastside catholic bellevue] [http://danimcreynolds.ifrance.com/web/wc-lock.html wc lock] [http://ingeborgmace.ifrance.com/the-greatest-vitamin.html the greatest vitamin in the world] [http://desiraeuren.ifrance.com/pages/scrapbook-patterned.html scrapbook patterned paper] [http://devorasievert.w8w.pl/daftpunk.html daftpunk] [http://lorettamcglade.w8w.pl/pinnacle-capture.html pinnacle capture card review] [http://marissaalbro.ifrance.com/az-fresh-im-iz.html az fresh im iz] [http://larascheid.ifrance.com/email-hosting.html email hosting] [http://devorasievert.w8w.pl/playstation-codes.html playstation codes] [http://lorettamcglade.w8w.pl/free-credit.html free credit report without a credit card] [http://chandaspalding.w8w.pl/blog/teen-thong-galleries.html teen thong galleries] [http://lulawork.w8w.pl/article/lisa-salters.html lisa salters] [http://larascheid.ifrance.com/garden-plants.html garden plants] [http://lorettamcglade.w8w.pl/teen-penis-size.html teen penis size poll] [http://tanyahale.w8w.pl/blog/someone-song.html someone song] [http://beataraasch.ifrance.com/one-step-closer.html one step closer linkin park] [http://kerriecrook.w8w.pl/data/real-estate-in.html real estate in hawaii] [http://guadalupemcquad.ifrance.com/html/silicone-sealant.html silicone sealant aquarium] [http://devorasievert.w8w.pl/angeles-car-frontier.html angeles car frontier los new rental] [http://desiraeuren.ifrance.com/pages/examen-escrito.html examen escrito] [http://lulawork.w8w.pl/article/polo-ralph-lauren.html polo ralph lauren sun glasses] [http://lucillacarreno.ifrance.com/article/spanish-people.html spanish people] [http://larascheid.ifrance.com/horse-training.html horse training] [http://ingeborgmace.ifrance.com/busty-crystal-storm.html busty crystal storm] [http://chandaspalding.w8w.pl/blog/kimblee-fade.html kimblee fade] [http://beataraasch.ifrance.com/angelic-layer.html angelic layer] [http://desiraeuren.ifrance.com/pages/women-masturbating.html women masturbating sounds] [http://lorettamcglade.w8w.pl/hawaii-romantic.html hawaii romantic wedding] [http://mollyschippers.w8w.pl/gulfport.html gulfport] [http://marissaalbro.ifrance.com/toxic-mold-sickness.html toxic mold sickness symptom] [http://tanyahale.w8w.pl/blog/crate-and-barrell.html crate and barrell] [http://chandaspalding.w8w.pl/blog/free-pc-to-phone.html free pc to phone] [http://georgieseaman.ifrance.com/small/principia-bike.html principia bike] [http://betsyharwood.w8w.pl/pj-proby-lyrics.html pj proby lyrics] [http://tanyahale.w8w.pl/blog/sam-ash-music.html sam ash music] [http://tanyahale.w8w.pl/blog/christian-fundraiser.html christian fundraiser] [http://tanyahale.w8w.pl/blog/trucking-rates.html trucking rates] [http://kerriecrook.w8w.pl/data/vicadin.html vicadin] [http://tanyahale.w8w.pl/blog/security-policy.html security policy example] [http://danimcreynolds.ifrance.com/web/seminole.html seminole] [http://mollyschippers.w8w.pl/wwwsearscom.html www.sears.com] [http://lorettamcglade.w8w.pl/clematis.html clematis] [http://lulawork.w8w.pl/article/boy-underwear.html boy underwear model] [http://devorasievert.w8w.pl/everything-my.html everything my family should know] [http://mollyschippers.w8w.pl/apple-vacation.html apple vacation] [http://guadalupemcquad.ifrance.com/html/anderson-coopers.html anderson coopers show] [http://guadalupemcquad.ifrance.com/html/apc-powerchute.html apc powerchute default password] [http://chandaspalding.w8w.pl/blog/spanish-flu-pandemic.html spanish flu pandemic of 1918] [http://tanyahale.w8w.pl/blog/tool-steel.html tool steel] [http://lucillacarreno.ifrance.com/article/sphinx.html sphinx] [http://desiraeuren.ifrance.com/pages/hawaiian-beaches.html hawaiian beaches] [http://betsyharwood.w8w.pl/evil-clown-tattoos.html evil clown tattoos] [http://marissaalbro.ifrance.com/pictures-of-mario.html pictures of mario singer] [http://betsyharwood.w8w.pl/memphis-area-real.html memphis area real estate] [http://lucillacarreno.ifrance.com/article/liquid-lsd.html liquid lsd] [http://lorettamcglade.w8w.pl/wild-animal-photographs.html wild animal photographs] [http://anamariasavard.w8w.pl/girls-giving-footjobs.html girls giving footjobs] [http://desiraeuren.ifrance.com/pages/mobile-home-refinancing.html mobile home refinancing] [http://tonitasmythe.ifrance.com/small/american-magazine.html american magazine photography] [http://georgieseaman.ifrance.com/small/joan-lunden.html joan lunden] [http://larascheid.ifrance.com/multi-spool-aircraft.html multi spool aircraft engine diagrams] [http://tanyahale.w8w.pl/blog/lyric-song-time.html lyric song time] [http://betsyharwood.w8w.pl/ismail-yk-son.html ismail yk son defa lyrics] [http://guadalupemcquad.ifrance.com/html/20-years-at.html 20 years at hull house summary] [http://lucillacarreno.ifrance.com/article/hon.html hon] [http://lucillacarreno.ifrance.com/article/wireless-digital.html wireless digital audio receivers] [http://tonitasmythe.ifrance.com/small/witham-hill-apartments.html witham hill apartments] [http://ingeborgmace.ifrance.com/irelands-four.html irelands four provinces virginia] [http://danimcreynolds.ifrance.com/web/russian-lady.html russian lady] [http://kerriecrook.w8w.pl/data/free-small-titties.html free small titties] [http://beataraasch.ifrance.com/how-to-paint-flames.html how to paint flames] [http://lucillacarreno.ifrance.com/article/ccie-pdf.html ccie pdf] [http://lucillacarreno.ifrance.com/article/preventing-hair.html preventing hair loss] [http://betsyharwood.w8w.pl/free-online-rpgs.html free online rpgs] [http://georgieseaman.ifrance.com/small/in-malawi-poverty.html in malawi poverty] [http://cheryshowman.w8w.pl/blog/ged-information.html ged information] [http://tonitasmythe.ifrance.com/small/miniature-golf-course.html miniature golf course math project] [http://danimcreynolds.ifrance.com/web/yahoo-dsl.html yahoo dsl] [http://tanyahale.w8w.pl/blog/bbs-kds.html bbs kds] [http://lucillacarreno.ifrance.com/article/alien-planet.html alien planet] [http://anamariasavard.w8w.pl/e-greeting-cards.html e greeting cards] [http://betsyharwood.w8w.pl/super-heroines.html super heroines] [http://larascheid.ifrance.com/instrument-transformer.html instrument transformer testing] [http://lucillacarreno.ifrance.com/article/dui-attorney.html dui attorney] [http://marissaalbro.ifrance.com/joyce-walky.html joyce walky] [http://devorasievert.w8w.pl/camen-electra.html camen electra] [http://desiraeuren.ifrance.com/pages/high-definition.html high definition television] [http://larascheid.ifrance.com/la-creperie.html la creperie bretonne] [http://cheryshowman.w8w.pl/blog/tampon-problems.html tampon problems] [http://larascheid.ifrance.com/mgm-studio-ticket.html mgm studio ticket] [http://cheryshowman.w8w.pl/blog/18th-amendment.html 18th amendment] [http://betsyharwood.w8w.pl/who-was-the-oldest.html who was the oldest president ever elected] [http://cheryshowman.w8w.pl/blog/world-fact-book.html world fact book] [http://tanyahale.w8w.pl/blog/nude-mom-family.html nude mom family] [http://lorettamcglade.w8w.pl/wet-t.html wet t] [http://betsyharwood.w8w.pl/kaaren.html kaaren] [http://ingeborgmace.ifrance.com/incline-village.html incline village nv luxury rentals] [http://marissaalbro.ifrance.com/swan-secure-products.html swan secure products] [http://marissaalbro.ifrance.com/the-jewelry.html the jewelry store.tv] [http://guadalupemcquad.ifrance.com/html/gunsmith-tools.html gunsmith tools] [http://lorettamcglade.w8w.pl/bikini-models-topless.html bikini models topless] [http://tanyahale.w8w.pl/blog/2007-toyota-tundra.html 2007 toyota tundra] [http://devorasievert.w8w.pl/musica-de-ranma.html musica de ranma 1 2] [http://lucillacarreno.ifrance.com/article/7934.html 7934] [http://chandaspalding.w8w.pl/blog/texas-holdem.html texas holdem poker] [http://lulawork.w8w.pl/article/mad-world-guitar.html mad world guitar tab] [http://larascheid.ifrance.com/high-school-diploma.html high school diploma] [http://tanyahale.w8w.pl/blog/thailand-property.html thailand property] [http://desiraeuren.ifrance.com/pages/yi-chuan.html yi chuan] [http://marissaalbro.ifrance.com/washington-redskins.html washington redskins] [http://marissaalbro.ifrance.com/unable-to-start.html unable to start email protection] [http://mollyschippers.w8w.pl/japanese-peace.html japanese peace character] [http://lorettamcglade.w8w.pl/riding-goggles.html riding goggles] [http://lucillacarreno.ifrance.com/article/atlanta-real-estate.html atlanta real estate listing] [http://ingeborgmace.ifrance.com/rainbow-sandals.html rainbow sandals] [http://larascheid.ifrance.com/phosphorus-rich.html phosphorus rich foods] [http://kerriecrook.w8w.pl/data/northwestern-oklahoma.html northwestern oklahoma state athletics] [http://lucillacarreno.ifrance.com/article/example-of-incentive.html example of incentive program] [http://chandaspalding.w8w.pl/blog/zemanova-movie.html zemanova movie free] [http://betsyharwood.w8w.pl/now-how-does.html now how does it feel] [http://kerriecrook.w8w.pl/data/kissin-mom.html kissin mom] [http://lucillacarreno.ifrance.com/article/roar.html roar] [http://beataraasch.ifrance.com/los-horcones-walden.html los horcones walden two] [http://tanyahale.w8w.pl/blog/carly-parker.html carly parker] [http://chandaspalding.w8w.pl/blog/sports-image.html sports image photography] [http://georgieseaman.ifrance.com/small/five-guys-one.html five guys one girl] [http://lucillacarreno.ifrance.com/article/fortune-telling.html fortune telling] [http://tanyahale.w8w.pl/blog/pictures-of-logging.html pictures of logging] [http://tonitasmythe.ifrance.com/small/online-medical.html online medical billing training programs] [http://chandaspalding.w8w.pl/blog/pjt-insurances.html pjt insurances] [http://betsyharwood.w8w.pl/3-16-eyelets.html 3 16 eyelets] [http://lucillacarreno.ifrance.com/article/joanns.html joanns] [http://desiraeuren.ifrance.com/pages/nephesh.html nephesh] [http://desiraeuren.ifrance.com/pages/eastenders-dress.html eastenders dress up dolls] [http://tanyahale.w8w.pl/blog/appalachian.html appalachian trail] [http://devorasievert.w8w.pl/the-mountaineer.html the mountaineer inn] [http://ingeborgmace.ifrance.com/wwwhi5com.html www.hi5.com] [http://lulawork.w8w.pl/article/everything-i.html everything i touch turns to gold midas touch lyrics] [http://lorettamcglade.w8w.pl/tiger-woods-wife.html tiger woods wife pic] [http://ingeborgmace.ifrance.com/english-to-spanish.html english to spanish dictionary] [http://beataraasch.ifrance.com/tuscany-wine.html tuscany wine] [http://beataraasch.ifrance.com/severina-vuckovic.html severina vuckovic porn video] [http://danimcreynolds.ifrance.com/web/erotic-digimon.html erotic digimon] [http://mollyschippers.w8w.pl/pony-beads.html pony beads] [http://lulawork.w8w.pl/article/san-fransisco.html san fransisco red book massage] [http://beataraasch.ifrance.com/facesitting-video.html facesitting video clips] [http://lucillacarreno.ifrance.com/article/horse-mating.html horse mating video] [http://marissaalbro.ifrance.com/m4-gun-case.html m4 gun case] [http://marissaalbro.ifrance.com/natali-portman.html natali portman wallpaper] [http://larascheid.ifrance.com/stratford-homes.html stratford homes]
{{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}}


==Keyvalues==
By default, only one <code>sky_camera</code> may be active at a time and it cannot move.
* {{kv angles}}
{{tip|
* '''3D Skybox Scale'''
* 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]
: <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
* 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.}}}}


* '''fogenable'''
== Keyvalues ==
: {{boolean}}
{{KV|Name|string|intn=targetname|The [[targetname]] that other entities refer to this entity by.|nofgd=1}}
* '''fogblend'''
{{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.}}
: {{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.
{{KV|Fog Enable|boolean|intn=fogenable|Enable Fog in the Skybox by Default}}
: 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.
{{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'.}}
: 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|}}
* '''use_angles'''
{{KV|Primary Fog Color|color255|intn=fogcolor|The Primary Color of the Fog in the Skybox}}
* '''fogcolor'''
{{KV|Secondary Fog Color|color255|intn=fogcolor2|The Secondary Color of the Fog in the Skybox that will be blended to}}
: {{color}}
{{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}}
* '''fogcolor2'''
{{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}}
: {{color}}
{{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'''.}}
* '''fogdir'''
{{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.}}
: <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'''.  
{{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.}}
* '''fogstart'''
{{KV|Fog Max Density|float|intn=fogmaxdensity|Fog Max Density [0..1]. Non-FGD in other games except {{gmod|1}}.|nofgd=1|also={{gmod}}}}
: <float> How far from the point-of-view the fog should start.
{{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.}}
* '''fogend'''
{{KV|Clip 3D sky near plane to world far plane|intn=clip_3D_skybox_near_to_world_far|boolean|only={{l4d2}}}}
: <float> How far from the point-of-view the view should be completely fogged.
{{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}}}}


==See also==
== Inputs ==
* [[Skybox Basics]] - How to make a skybox.
{{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.}}
 
== See also ==
* [[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