This article's documentation is for Source 2. Click here for more information.

light_ortho

From Valve Developer Community
Jump to navigation Jump to search

light_ortho is a point entity available in SteamVR Home SteamVR Home, Half-Life: Alyx Half-Life: Alyx, and Counter-Strike 2 Counter-Strike 2. It creates an invisible orthographic point light source that can cast both real-time and baked light. The light is cast orthographically with a rectangular cross section.

Icon-Bug.pngBug:By default the light is not limited to the rectangular volume, and will cast outside of it with broken shadows. Setting a Light cookie makes it work properly.  [todo tested in?]


In SteamVR Home, the real-time component casts a single shadow map. The number of simultaneously rendered real-time lights are limited to 16, or lower if a higher shadow resolution than default is set.


Keyvalues

Todo: Add any new keyvalues from HL:A.

Source 2 Transform:

Origin (origin) <coordinates>
The world space origin of the entity.
Angles (angles) <angles>
The pitch, yaw, roll orientation of the entity.
Scale (scales) <vector>
The x, y, z scales of the entity. Not all entities can use this.
Transform Locked (transform locked) <boolean>
Lock the transform at its current value, preveting the transform of the node from being modified.
Force Hidden (force hidden) <boolean>
Visually hides the entity from the viewports. The Outliner pane will still list hidden entities.
Editor Only (editor only) <boolean>
Entity is only displayed in Hammer and will not appear in game.


Source 2 Targetname:
Name (targetname) <string>
The targetname that other entities refer to this entity by.
Entity Scripts (vscripts) <scriptlist>
Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.
Create Client-Only Entity (clientSideEntity) <choices>
  • 0: No
  • 1: Yes


Source 2 Hierarchy:
Parent (parentname) <targetname>
Specifies a movement parent. An entity will maintain its initial offset from its parent.
Parent Model Bone/Attachment Name (parentAttachmentName) <string>
The name of the bone or attachment to attach to on the entity's parent in the movement hierarchy. Use !bonemerge to use bone-merge style attachment.
Model Attachment position offset (local.origin) <coordinates>
Offset in the local space of the parent model's attachment/bone to use in hierarchy. Not used if you are not using parent attachment.
Model Attachment angular offset (local.angles) <angles>
Angular offset in the local space of the parent model's attachment/bone to use in hierarchy. Not used if you are not using parent attachment.
Model Attachment scale (local.scales) <vector>
Scale in the local space of the parent model's attachment/bone to use in hierarchy. Not used if you are not using parent attachment.
Use Model Attachment Offset (useLocalOffset) <boolean>
Whether to respect the specified local offset when doing the initial hierarchical attachment to its parent.


Source 2 Light:
Enabled (enabled) <boolean>
Sets the initial on/off state of the light.
Color (color) <color255>
The RGB color of the light.
Brightness (brightness) <float>
The brightness of the light. The value can be increased over 1.0
Range (range) <float>
Distance range for light. 0 : infinite.
Cast Shadows (castshadows) <choices>
Whether this light casts shadow.
  • 0: No
  • 1: Yes
  • 2: Baked Only
Shadow Near Clip Plane (nearclipplane) <float>
Distance in game units for near clip plane for shadow map.
Appearance (style) <choices>
Various Custom Appearance presets.
Lightstyle presets
(epilepsy warning)
Literal Value Description Sequence Preview
0 Normal m Lightstyle 0.png
10 Fluorescent flicker mmamammmmammamamaaamammma Lightstyle 10.gif
2 Slow, strong pulse abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba Lightstyle 2.gif
11 Slow pulse, noblack abcdefghijklmnopqrrqponmlkjihgfedcba Lightstyle 11.gif
5 Gentle pulse jklmnopqrstuvwxyzyxwvutsrqponmlkj Lightstyle 5.gif
1 Flicker A mmnmmommommnonmmonqnmmo Lightstyle 1.gif
6 Flicker B nmonqnmomnmomomno Lightstyle 6.gif
3 Candle A mmmmmaaaaammmmmaaaaaabcdefgabcdefg Lightstyle 3.gif
7 Candle B mmmaaaabcdefgmmmmaaaammmaamm Lightstyle 7.gif
8 Candle C mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa Lightstyle 8.gif
4 Fast strobe mamamamamama Lightstyle 4.gif
9 Slow strobe aaaaaaaazzzzzzzz Lightstyle 9.gif
12 !FGD Underwater light mutation mmnnmmnnnmmnn Lightstyle 12.gif
Custom Appearance (pattern) <string>
Set a custom pattern of light brightness for this light. Pattern format is a string of characters, where 'a' is total darkness, 'z' fully bright. i.e. 'aaggnnttzz' would be a steppy fade in from dark to light.
Start Fade Dist (fademindist) <float>
Distance at which the light starts to fade (<0 : use fademaxdist).
End Fade Dist (fademaxdist) <float>
Maximum distance at which the light is visible (0 : don't fade out).
Render to Cubemaps (rendertocubemaps) <boolean>
If true, this geometry renders into baked cube maps
Priority (priority) <integer>
When the number of visible lights exceeds the rendering budget, higher priority lights are chosen for rendering first.
Indirect Light Multiplier (bouncescale) <float>
Multiplies the brightness of light bouncing of surfaces.
Render Diffuse (renderdiffuse) <boolean>
Toggles baking and rendering of diffuse lighting (per-pixel, lightmaps,light probe volumes and bounced light on cubemaps).
Render Specular (renderspecular) <choices>
Controls rendering of direct specular highlights. This applies a bright sphere effect to reflections.
  • 0: Off
  • 1: On - Render in real-time.
  • 2: Bake into cubemaps (Source 1 behavior)
Enabled (directlight) <choices>
How direct lighting should be represented.
  • 0: None
  • 1: Baked
  • 2: Per-Pixel
  • 3: Mixed
    Todo: possibly deprecated
Enabled (indirectlight) <choices>
How indirect lighting should be represented.
  • 0: None
  • 1: Baked


Light Cookie (lightcookie) ([todo internal name (i)]) <string>
Light cookie to use. Limited to the textures in effects/lightcookies.vtex
Width (ortholightwidth) ([todo internal name (i)]) <float>
Ortho light rectangle width in game units.
Height (ortholightheight) ([todo internal name (i)]) <float>
Ortho light rectangle height in game units.
Range (range) ([todo internal name (i)]) <float>
Distance range for light. 0: infinite
Note.pngNote:Setting this to 0 breaks shadows.
SunSpreadAngle (angulardiameter) ([todo internal name (i)]) <float>
The angular extent of the light for casting soft shadows. Higher numbers are more diffuse. 1 is a good starting value.
Note.pngNote:Only affects baked lighting.
Shadow Texture Width (shadowtexturewidth) ([todo internal name (i)]) <integer>
Width of the shadow map texture. If set to 0, it uses the default texture resolution (1024)

Inputs

Source 2 Light:
SetLightEnabled <integer>
Sets whether the light is enabled (takes parameter of 0 or 1)
TurnOn
Turn the light on.
TurnOff
The the light off.
Toggle
Toggle the light's current state.
SetLightColor <vector>
Set light color.
SetLightBrightness <float>
Set light brightness.
SetAppearance <integer>
Set appearance 0: Normal 1: Flicker A, 2: Slow, strong pulse 3: Candle A ...
SetCustomAppearance <string>
Set a custom pattern of light brightness for this light. Pattern format is a string of characters, where 'a' is total darkness, 'z' fully bright. i.e. 'aaggnnttzz' would be a steppy fade in from dark to light.


Source 2 Targetname:
Kill
Removes this entity from the world.
KillHierarchy
Removes this entity and all its children from the world.
AddOutput <string>
Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
Format: <key> <value>
Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1 to FireUser4
Fire the OnUser outputs; see User Inputs and Outputs.


RunScriptFile <string>
Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
RunScriptCode <string>
Execute a string of VScript source code in the scope of the entity receiving the input.
CallScriptFunction <string>
Call a script function.
CallPrivateScriptFunction <string>
Calls a script function from this entity's private script scope.
CallGlobalScriptFunction <string>
Calls a script function in the global script scope.


Source 2 Hierarchy:
SetParent <string>
Changes the entity's parent in the movement hierarchy.
SetParentAttachment <string>
Change this entity to attach to a specific attachment point on its parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment.
SetParentAttachmentMaintainOffset <string>
Change this entity to attach to a specific attachment point on it's parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment. The entity will maintain it's position relative to the parent at the time it is attached.
ClearParent
Removes this entity from the the movement hierarchy, leaving it free to move independently.


Outputs

Source 2 Targetname:
OnUser1 to OnUser4
These Outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 Input; see User Inputs and Outputs.
OnKilled
This Output fires when the entity is killed and removed from the game.


See also