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

Point spotlight: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
 
(88 intermediate revisions by 37 users not shown)
Line 1: Line 1:
[http://movies.eskout.cn/huge-orgasm.html huge orgasm] [http://anal.eskout.cn/mortgage-loan.html mortgage loan real estate] [http://teen.eskout.cn/milf-slut.html milf slut] [http://hardcore.eskout.cn/lara-croft-xxx.html lara croft xxx] [http://anal.eskout.cn/lesbain-hentai.html lesbain hentai] [http://porno.eskout.cn/lesbians-naked.html lesbians naked] [http://www.lattialaatta.scriptmania.com home] [http://teens.eskout.cn/erect-clits.html erect clits] [http://movies.eskout.cn/monster-pussy.html monster pussy] [http://anal.eskout.cn/adult-bondage.html adult bondage] [http://anal.eskout.cn/unreal-boobs.html unreal boobs] [http://xxx.eskout.cn/carnival-glory.html carnival glory] [http://naked.eskout.cn/gay-russian-boys.html gay russian boys] [http://playboy.eskout.cn/ssss.html ssss] [http://fuck.eskout.cn/male-mastubation.html male mastubation] [http://naked.eskout.cn/mai-hoshino.html mai hoshino] [http://lesbian.eskout.cn/female-cum.html female cum] [http://porno.eskout.cn/women-having-sex.html women having sex with women] [http://teens.eskout.cn/allme.html allme] [http://blondes.eskout.cn/gay-teachers.html gay teachers] [http://movies.eskout.cn/free-group-sex.html free group sex pics] [http://fuck.eskout.cn/guys-eating-pussy.html guys eating pussy] [http://hentai.eskout.cn/tranny-sex.html tranny sex] [http://lesbian.eskout.cn/adult-cam.html adult cam] [http://xxx.eskout.cn/sock-sex.html sock sex] [http://blondes.eskout.cn/ass-and-pussy.html ass and pussy] [http://teens.eskout.cn/child-care-services.html child care services] [http://women.eskout.cn/canadian-girls.html canadian girls] [http://lesbian.eskout.cn/underage-preteens.html underage preteens] [http://anal.eskout.cn/flower-girl-gifts.html flower girl gifts] [http://hardcore.eskout.cn/cock-milking.html cock milking] [http://incest.eskout.cn/breast-reduction.html breast reduction surgery] [http://anal.eskout.cn/foo-fighters.html foo fighters my hero] [http://girl.eskout.cn/hair-fetish.html hair fetish] [http://hentai.eskout.cn/bush-sucks.html bush sucks] [http://anal.eskout.cn/rough-sex-movies.html rough sex movies] [http://naked.eskout.cn/creative-spanked.html creative spanked wife] [http://naked.eskout.cn/finger-pussy.html finger pussy] [http://porn.eskout.cn/cartoon-spanking.html cartoon spanking] [http://incest.eskout.cn/honey-moons.html honey moons] [http://sex.eskout.cn/genital-herpes.html genital herpes pictures] [http://fuck.eskout.cn/hainan-island.html hainan island] [http://xxx.eskout.cn/nigger-sex.html nigger sex] [http://naked.eskout.cn/spyware-removal.html spyware removal colorado springs] [http://sex.eskout.cn/cane-spanking.html cane spanking] [http://women.eskout.cn/asian-mature.html asian mature] [http://porno.eskout.cn/payroll-software.html payroll software program] [http://anal.eskout.cn/sexe-gratuit.html sexe gratuit] [http://hentai.eskout.cn/busca-sexo.html busca sexo] [http://girls.eskout.cn/eros-lube.html eros lube] [http://teens.eskout.cn/sucking-big-cock.html sucking big cock] [http://porno.eskout.cn/best-prices-for.html best prices for wet suits] [http://teens.eskout.cn/company-profiles.html company profiles] [http://fuck.eskout.cn/chyna-sex-video.html chyna sex video] [http://hardcore.eskout.cn/brutal-spankings.html brutal spankings] [http://porn.eskout.cn/acne-solution.html acne solution] [http://girl.eskout.cn/poodle-skirt.html poodle skirt] [http://hentai.eskout.cn/crotchless-bikini.html crotchless bikini] [http://girl.eskout.cn/lesbian-shemales.html lesbian shemales] [http://hentai.eskout.cn/skinny-naked-girls.html skinny naked girls] [http://girls.eskout.cn/tickling-forum.html tickling forum] [http://porno.eskout.cn/truc-chatte-chaleur.html truc chatte chaleur] [http://girls.eskout.cn/latina-nude.html latina nude] [http://women.eskout.cn/kitchen-chef.html kitchen chef decor] [http://fuck.eskout.cn/playboy-pics.html playboy pics] [http://sex.eskout.cn/oklahoma-casino.html oklahoma casino gambling] [http://porn.eskout.cn/leosbb.html leosbb] [http://women.eskout.cn/colorado-clothing.html colorado clothing] [http://www.heharpen.00server.com here] [http://teen.eskout.cn/bizarre-insertion.html bizarre insertion] [http://teen.eskout.cn/wife-sex-stories.html wife sex stories] [http://www.hehiggin.mysite.com here] [http://www.weightwithwhait.20megsfree.com map] [http://porn.eskout.cn/tax-lien-certificates.html tax lien certificates] [http://girls.eskout.cn/naked-underage.html naked underage boys] [http://www.beepworld.de/members/pridurok-75/ here] [http://anal.eskout.cn/spice-girls-stop.html spice girls stop] [http://incest.eskout.cn/fuck-daughter.html fuck daughter] [http://women.eskout.cn/charlize-theron.html charlize theron naked] [http://xxx.eskout.cn/savanna-samson.html savanna samson hardcore] [http://anal.eskout.cn/digimon-girls.html digimon girls] [http://girls.eskout.cn/sample-sex-videos.html sample sex videos] [http://anal.eskout.cn/skinny-bitches.html skinny bitches] [http://naked.eskout.cn/tit-wanks.html tit wanks] [http://anal.eskout.cn/sunbathing.html sunbathing] [http://anal.eskout.cn/cohf-tina.html cohf tina] [http://incest.eskout.cn/ella-enchanted.html ella enchanted] [http://www.rerlfcoco.i8.com page] [http://windchanter.page.tl page] [http://lesbian.eskout.cn/cocker-spaniel-breeder.html cocker spaniel breeder] [http://anal.eskout.cn/sexy-neighbors.html sexy neighbors] [http://anal.eskout.cn/lesbian-porn-videos.html lesbian porn videos] [http://girls.eskout.cn/easy-drunk-girls.html easy drunk girls] [http://teen.eskout.cn/shemale-queens.html shemale queens] [http://anal.eskout.cn/blissbox.html blissbox] [http://hardcore.eskout.cn/asian-girls.html asian girls] [http://blondes.eskout.cn/goku-naked.html goku naked] [http://teens.eskout.cn/sucking-hard.html sucking hard] [http://www.maliesuk.safewebshop.com page] [http://women.eskout.cn/hot-teen-girls.html hot teen girls]  
{{LanguageBar}}
{{wrongtitle|title=point_spotlight}}
{{CD|CPointSpotlight|file1=1}}
== Entity description ==
[[File:PointSpotlight.jpg|thumb|right|192px|A point_spotlight.]]
An entity to draw a spotlight primarily consisting of two glow sprites: A beam when the player views it side on, and a halo when it's facing towards the player. Unless the 'No Dynamic Light' spawn flag is checked, it will also create a dynamic light wherever the end of the spotlight rests.
{{this is a|point entity|name=point_spotlight}} Creates two glow sprite effects: a ''beam'' effect for viewers outside the light cone and a ''halo'' effect for viewers inside the cone. Also creates dynamic light at the end of the beam if desired flags are set which is achieved using {{ent|spotlight_end}}.
{{note|Without the dynamic light this entity will just provide a sprite effect, and will not serve as an actual light source.}}


== Keyvalues ==
The {{ent|spotlight_end}} functionality can be disabled with the 'No Dynamic Light' spawnflag. In that state, the spotlight will not actually illuminate other objects on its own and can be used with an accompanying {{ent|light_spot}} or {{ent|env_projectedtexture}} instead.
* {{kv targetname}}
* {{kv parentname}}
* {{kv renderfields}}
* {{kv angles}}
* {{kv hdrcolorscale}}


* '''spotlightlength'''
{{bug|hidetested=1|In {{portal2|4}} and {{bms|4}} the '''Alpha''' (''renderamt'') property is not functional at all, use '''HDRColorScale''' instead.}}
: <integer> Length of the spotlight beam.
{{warning|This entity generates 3 [[edict]]s (for itself, the beam visual and beam target respectively: {{mono|point_spotlight}}, {{ent|beam}}, {{ent|spotlight_end}}! In {{tf2|4}} and {{gmod|4}}, the <code>point_spotlight</code> itself has been converted to a server-only entity (does not take up an edict), and in {{tf2|4}}, when no targetname and parentname is assigned, the <code>point_spotlight</code> and <code>spotlight_end</code> entity is also killed, thus consuming 1 edict in total for a static spotlight.}}
{{bug|tested={{hl2}},{{bms}}|Killing this entity either by '''Kill''' input or by killing its parent while it's turned on will leave behind the <kbd>beam</kbd> and <kbd>spotlight_end</kbd> entities. Beam won't be visible but the spotlight_end will be.
{{workaround|Fire '''LightOff''' input first, then with small delay '''Kill'''.}}
}}
{{note|{{ent|beam}} collides only with [[prop_static]] and world geometry, this means that beam of [[point_spotlight]] and dynamic light will ignore any dynamic objects (with the exception of [[func_physbox]]), [[NPC]]s, [[physics objects]], e.t.c.}}


* '''spotlightwidth'''
{{expand|title=Third-Party notices {{asd}}{{bms}}|
: <integer> Width of the spotlight beam.
{{note|In {{asd|4}} this entity is not supported and on loading a map all point_spotlight entities will be converted to [[Light deferred]]!}}
{{important|{{bms|4}} are using [[deferred lighting]] for [[spotlight_end|light source from this entity]].}}
}}


* '''rendercolor'''
== Keyvalues ==
: {{color}} The color of the spotlight cone.
{{KV Targetname}}
{{KV|Ignore Solid|intn=IgnoreSolid|bool|If set, this spotlight won't trace for solids, emitting at its full length and ignoring potential obstructions.|since={{src13mp}}|also={{gmod}}{{mapbase}}  ,  {{!fgd}} in {{bms}}}}
{{KV|Spotlight Length|intn=SpotlightLength|integer|Length of the spotlight beam.}}
{{KV|Spotlight Width|intn=SpotlightWidth|integer|Width of the spotlight beam.}}
{{KV|Color (R G B)|intn=rendercolor|color255|Spotlight color.}}
{{KV|HDR color scale.|intn=HDRColorScale|float|Float value to multiply sprite color by when running in HDR mode.}}
{{KV|Halo size scale.|intn=HaloScale|float|Float value to determine the size of the halo.|since={{l4d2}}|also={{mapbase}}}}
{{expand|title={{mapbase|4}} only properties|
{{KV|Halo material|intn=HaloMaterial|string|Material to use for the halo.}}
{{KV|Spotlight beam material|intn=SpotlightMaterial|string|Material to use for the spotlight's beam.}}
}}
{{expand|title=Performance properties|
{{KV DXLevelChoice}}
{{KV SystemLevelChoice}}
}}


== Flags ==
== Flags ==
* 1 : Start On
{{Fl|1|Start On}}
: Sets the point_spotlight to be turned on when it spawns.
{{Fl|2|No Dynamic Light}}
{{bug|hidetested=1|In {{l4d2|4}} alpha of spawned {{ent|spotlight_end}} is set wrongly causing no light to be visible. {{fix|Use following script as point_spotlight's Entity script {{ExpandBox|<syntaxhighlight lang=js>function L4D2PointSpotlightFix() {
    for(local ent; ent = Entities.FindByClassname(ent, "spotlight_end");) {
        if(NetProps.GetPropEntity(ent, "m_hOwnerEntity") == self) {
            local clrrender = NetProps.GetPropInt(self, "m_clrRender");
            NetProps.SetPropInt(ent, "m_clrRender", clrrender);
            return;
        }
    }
}


* 2 : No Dynamic Light
function OnPostSpawn() {
: Prevents a dynamic light from being generated by the point_spotlight. Dynamic lights can be costly for performance, so this flag should be checked to improve framerate.
    if((NetProps.GetPropInt(self, "m_spawnflags") & 3) == 0) {
        L4D2PointSpotlightFix();
    }
    self.ConnectOutput("OnLightOn", "L4D2PointSpotlightFix")
}</syntaxhighlight>}}}}}}


== Inputs ==
== Inputs ==
*{{i targetname}}
{{I|LightOn|Turn the spotlight on.}}
*{{i parentname}}
{{I|LightOff|Turn the spotlight off.}}
*{{i renderfields}}
{{I|LightToggle|Toggles the spotlight on/off|only={{mapbase}}}}
{{I|SetColor|Change the color of the spotlight. Light must be turned off then back on for dynamic light to update.|param=color255|since={{AS}}|also={{GMOD}}}}
:{{note|Functionally identical to the {{mono|Color}} input. A delay of at least 0.01 is required before the spotlight is turned back on, or else it will remain off.}}
{{I|ForceUpdate|Force an update of the spotlight position and orientation.|since={{AS}}|also={{GMOD}}}}


* '''LightOn'''
== Outputs ==
{{O|OnLightOn|ac-is-this=1|Fires when light turns on.}}
{{O|OnLightOff|ac-is-this=1|Fires when light turns off.}}


* '''LightOff'''
== Code related ==
 
By default, point_spotlight uses the material ''sprites/glow_test02.vmt''. You can change this if you are shipping your own binaries by going into ''point_spotlight.cpp'' in the server project, navigating to line 351 and replacing the file path with your own material or a reference to a variable set via a KV similarly as {{mapbase|4}}'s <kbd>SpotlightMaterial</kbd> KV.
== Outputs ==
* {{o targetname}}


== See also ==
== See also ==
* [[light_spot]]
* [[Lighting]]
* [[npc_spotlight]]


[[Category:Entities]]
[[Category:Lighting]]

Latest revision as of 03:43, 20 July 2025

English (en)Русский (ru)Translate (Translate)
C++ Class hierarchy
CPointSpotlight
CPointEntity
CBaseEntity
C++ point_spotlight.cpp
A point_spotlight.

point_spotlight is a point entity available in all Source Source games. Creates two glow sprite effects: a beam effect for viewers outside the light cone and a halo effect for viewers inside the cone. Also creates dynamic light at the end of the beam if desired flags are set which is achieved using spotlight_end.

The spotlight_end functionality can be disabled with the 'No Dynamic Light' spawnflag. In that state, the spotlight will not actually illuminate other objects on its own and can be used with an accompanying light_spot or env_projectedtexture instead.

Icon-Bug.pngBug:In Portal 2 Portal 2 and Black Mesa Black Mesa the Alpha (renderamt) property is not functional at all, use HDRColorScale instead.
Warning.pngWarning:This entity generates 3 edicts (for itself, the beam visual and beam target respectively: point_spotlight, beam, spotlight_end! In Team Fortress 2 Team Fortress 2 and Garry's Mod Garry's Mod, the point_spotlight itself has been converted to a server-only entity (does not take up an edict), and in Team Fortress 2 Team Fortress 2, when no targetname and parentname is assigned, the point_spotlight and spotlight_end entity is also killed, thus consuming 1 edict in total for a static spotlight.
Icon-Bug.pngBug:Killing this entity either by Kill input or by killing its parent while it's turned on will leave behind the beam and spotlight_end entities. Beam won't be visible but the spotlight_end will be.
PlacementTip.pngWorkaround:Fire LightOff input first, then with small delay Kill.
  (tested in: Half-Life 2,Black Mesa)
Note.pngNote:beam collides only with prop_static and world geometry, this means that beam of point_spotlight and dynamic light will ignore any dynamic objects (with the exception of func_physbox), NPCs, physics objects, e.t.c.
Third-Party notices Alien Swarm DeferredBlack Mesa
Note.pngNote:In Alien Swarm Deferred Alien Swarm Deferred this entity is not supported and on loading a map all point_spotlight entities will be converted to Light deferred!

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Ignore Solid (IgnoreSolid) <boolean> (in all games since Source 2013 Multiplayer) (also in Garry's ModMapbase , !FGD in Black Mesa)
If set, this spotlight won't trace for solids, emitting at its full length and ignoring potential obstructions.
Spotlight Length (SpotlightLength) <integer>
Length of the spotlight beam.
Spotlight Width (SpotlightWidth) <integer>
Width of the spotlight beam.
Color (R G B) (rendercolor) <color255>
Spotlight color.
HDR color scale. (HDRColorScale) <float>
Float value to multiply sprite color by when running in HDR mode.
Halo size scale. (HaloScale) <float> (in all games since Left 4 Dead 2) (also in Mapbase)
Float value to determine the size of the halo.
Mapbase Mapbase only properties
Halo material (HaloMaterial) <string>
Material to use for the halo.
Spotlight beam material (SpotlightMaterial) <string>
Material to use for the spotlight's beam.
Performance properties
Minimum / Maximum DX Level (mindxlevel / maxdxlevel) <integer choices> (removed since Left 4 Dead)
The entity will not exist if the engine is running outside the given range of DirectX Versions.
Choices
Warning.pngWarning:If these are used, the object may break when the user switches their DirectX settings.[missing string]
Minimum / Maximum Effect Details Level (mincpulevel / maxcpulevel) <integer choices> (in all games since Left 4 Dead)
Don't render for players with Effect Details levels that exceed the minimum or maximum.
Choices
  • 0: Default ("Low" for mincpulevel, "High" for maxcpulevel)
  • 1: Low
  • 2: Medium
  • 3: High
Minimum / Maximum Shader Details Level (mingpulevel / maxgpulevel) <integer choices> (in all games since Left 4 Dead)
Don't render for players with Shader Details levels that exceed the minimum or maximum.
Choices
  • 0: Default ("Low" for mingpulevel, "Very High" for maxgpulevel)
  • 1: Low
  • 2: Medium
  • 3: High
  • 4: Very High
See also:  cpu_level / gpu_level convars

Flags

Start On : [1]
No Dynamic Light : [2]
Icon-Bug.pngBug:In Left 4 Dead 2 Left 4 Dead 2 alpha of spawned spotlight_end is set wrongly causing no light to be visible.
Note.pngFix:Use following script as point_spotlight's Entity script

function L4D2PointSpotlightFix() {
    for(local ent; ent = Entities.FindByClassname(ent, "spotlight_end");) {
        if(NetProps.GetPropEntity(ent, "m_hOwnerEntity") == self) {
            local clrrender = NetProps.GetPropInt(self, "m_clrRender");
            NetProps.SetPropInt(ent, "m_clrRender", clrrender);
            return;
        }
    }
}

function OnPostSpawn() {
    if((NetProps.GetPropInt(self, "m_spawnflags") & 3) == 0) {
        L4D2PointSpotlightFix();
    }
    self.ConnectOutput("OnLightOn", "L4D2PointSpotlightFix")
}

Inputs

LightOn
Turn the spotlight on.
LightOff
Turn the spotlight off.
LightToggle  (only in Mapbase)
Toggles the spotlight on/off
SetColor <color255RedirectInput/color32> (in all games since Alien Swarm) (also in Garry's Mod)
Change the color of the spotlight. Light must be turned off then back on for dynamic light to update.
Note.pngNote:Functionally identical to the Color input. A delay of at least 0.01 is required before the spotlight is turned back on, or else it will remain off.
ForceUpdate  (in all games since Alien Swarm) (also in Garry's Mod)
Force an update of the spotlight position and orientation.

Outputs

OnLightOn
!activator = !caller = this entity
Fires when light turns on.
OnLightOff
!activator = !caller = this entity
Fires when light turns off.

Code related

By default, point_spotlight uses the material sprites/glow_test02.vmt. You can change this if you are shipping your own binaries by going into point_spotlight.cpp in the server project, navigating to line 351 and replacing the file path with your own material or a reference to a variable set via a KV similarly as Mapbase Mapbase's SpotlightMaterial KV.

See also