Beam spotlight: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(since left 4 dead 2(?))
(updates)
Line 1: Line 1:
{{base point|beam_spotlight|sprites=1|since=Left 4 Dead 2}} It is used to draw a spotlight. Will draw a beam when the player views it side on, and a halo when it's facing towards the player. Unless the 'No Dynamic Light' spawnflag is checked, it will also create a dynamic light wherever the end of the spotlight rests. Other than its ability to rotate, this entity is functionally identical to [[point_spotlight]].
{{lang|Beam spotlight}}
{{base point|beam_spotlight|sprites=1|since=Left 4 Dead}} It is used to draw a spotlight. Will draw a beam when the player views it side on, and a halo when it's facing towards the player. It will also create a dynamic light wherever the end of the spotlight rests. Other than its ability to rotate, this entity is functionally identical to {{ent|point_spotlight}}.


This spotlight is entirely client side, it is not sync'd across clients.
{{note|This spotlight is entirely client side, and rotation may be desynchronized between clients.}}


{{tip|Can be set to rotate for a lighthouse search beam effect.}}
{{idea|Can be set to rotate for a lighthouse search beam effect.}}


== Keyvalues ==
{{code class|CBeamSpotlight|beamspotlight.cpp}}
{{KV|Max Rotation Speed|integer|The maximum rotation speed of the spotlight, in degrees per second.}}
 
{{KV|Spotlight Length|integer|Length of the spotlight beam.}}
==Flags==
{{KV|Spotlight Width|integer|Width of the spotlight beam.}}
*1: Start On
{{KV|Color (R G B)|color255|The color of the beam. Black makes the beam invisible, so no "Shadow Beams." }}
*2: No Dynamic Light - Do not create any actual light. This may look unrealistic.
{{KV|HDR color scale.|float|float value to multiply sprite color by when running in HDR mode.}}
*4: Start rotation on
{{KV Targetname}}
*8: Reverse Direction
{{KV Parentname}}
*16: X Axis ({{clarify}} are these axes relative to the world or to the entity?)
*32: Y Axis
 
==Keyvalues==
{{KV|Max Rotation Speed (maxspeed)|integer|The maximum rotation speed of the spotlight, in degrees per second.}}
{{KV|Spotlight Length (SpotlightLength)|integer|Length of the spotlight beam.}}
{{KV|Spotlight Width (SpotlightWidth)|integer|Width of the spotlight beam.}}
{{KV|Color (R G B) (rendercolor)|color255|The color of the beam. Black makes the beam invisible.}}
{{KV|HDR color scale (HDRColorScale)|float|float value to multiply sprite color by when running in HDR mode.}}
{{KV|Halo Sprite (HaloSprite)|sprite|The material that should be used for the halo.}}
{{KV|Beam Sprite (BeamSprite)|sprite|The material that should be used for the beam.}}
{{KV RenderFields}}
{{KV RenderFields}}
{{KV Angles}}
{{KV DXLevelChoice}}
{{KV SystemLevelChoice}}
{{KV SystemLevelChoice}}
{{KV BaseEntity}}


== Flags ==
==Inputs==
:* 1 : Start On
:* 2 : No Dynamic Light
:* 4 : Start rotation on
:* 8 : Reverse Direction
:* 16 : X Axis
:* 32 : Y Axis
 
== Inputs ==
{{IO|LightOn|Turn the spotlight on.}}
{{IO|LightOn|Turn the spotlight on.}}
{{IO|LightOff|Turn the spotlight off}}
{{IO|LightOff|Turn the spotlight off}}
{{IO|Start|Start the rotator rotating.}}
{{IO|Start|Start rotating.}}
{{IO|Stop|Stop the rotator from rotating.}}
{{IO|Stop|Stop rotating.}}
{{IO|Reverse|Reverse the direction of rotation of the rotator.}}
{{IO|Reverse|Reverse the direction of rotation.}}
{{I Targetname}}
{{I Parentname}}
{{I RenderFields}}
{{I RenderFields}}
{{I BaseEntity}}


== Outputs ==
==Outputs==
{{IO|OnLightOn|Fires when light turns on.}}
{{IO|OnLightOn|Fires when light turns on.}}
{{IO|OnLightOff|Fires when light turns off.}}
{{IO|OnLightOff|Fires when light turns off.}}
{{O Targetname}}
{{O BaseEntity|l4d=1}}


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

Revision as of 03:06, 22 September 2018

English (en)Русский (ru)Translate (Translate)

Template:Base point It is used to draw a spotlight. Will draw a beam when the player views it side on, and a halo when it's facing towards the player. It will also create a dynamic light wherever the end of the spotlight rests. Other than its ability to rotate, this entity is functionally identical to point_spotlight.

Note.pngNote:This spotlight is entirely client side, and rotation may be desynchronized between clients.
Tip.pngIdea:Can be set to rotate for a lighthouse search beam effect.
C++ In code, it is represented by theCBeamSpotlightclass, defined in thebeamspotlight.cppfile.

Flags

  • 1: Start On
  • 2: No Dynamic Light - Do not create any actual light. This may look unrealistic.
  • 4: Start rotation on
  • 8: Reverse Direction
  • 16: X Axis ([Clarify] are these axes relative to the world or to the entity?)
  • 32: Y Axis

Keyvalues

Max Rotation Speed (maxspeed) ([todo internal name (i)]) <integer>
The maximum rotation speed of the spotlight, in degrees per second.
Spotlight Length (SpotlightLength) ([todo internal name (i)]) <integer>
Length of the spotlight beam.
Spotlight Width (SpotlightWidth) ([todo internal name (i)]) <integer>
Width of the spotlight beam.
Color (R G B) (rendercolor) ([todo internal name (i)]) <color255>
The color of the beam. Black makes the beam invisible.
HDR color scale (HDRColorScale) ([todo internal name (i)]) <float>
float value to multiply sprite color by when running in HDR mode.
Halo Sprite (HaloSprite) ([todo internal name (i)]) <sprite>
The material that should be used for the halo.
Beam Sprite (BeamSprite) ([todo internal name (i)]) <sprite>
The material that should be used for the beam.

RenderFields:


Render Mode (rendermode) <byte choices>
Set a non-standard rendering mode on this entity.
Render Modes
  • 0: Normal
  • 1: Color
  • 2: Texture
  • 3: Glow
  • 4: Solid/Alphatest Obsolete
  • 5: Additive
  • 6: Removed, does nothing Obsolete
  • 7: Additive Fractional Frame
  • 8: Alpha Add
  • 9: World Space Glow
  • 10: Don't Render
Render FX (renderfx) <byte choices>
Various somewhat legacy alpha effects. See render effects.
Render Amount / Transparency (renderamt) <byte>
Transparency amount, requires a Render Mode other than Normal. 0 is invisible, 255 is fully visible.
Render Color (R G B) (rendercolor) <color255>
Color tint.
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


Inputs

LightOn
Turn the spotlight on.
LightOff
Turn the spotlight off
Start
Start rotating.
Stop
Stop rotating.
Reverse
Reverse the direction of rotation.

RenderFields:

Alpha <integer 0–255>
Sets the entity's transparency to a number from 0 (invisible) to 255 (fully visible). Requires the entity to have its rendermode set to a number other than 0.
Color <color255RedirectInput/color32>
Sets an RGB color for the entity.


Outputs

OnLightOn
Fires when light turns on.
OnLightOff
Fires when light turns off.