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

Light directional: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (Corrected the redirect)
 
(37 intermediate revisions by 17 users not shown)
Line 1: Line 1:
{{base point|light_directional|internal=true|since=Left 4 Dead}} It is a directional light with no falloff, similar to the direct lighting of [[light_environment]].
{{CD|CLight|file1=lights.cpp|link=/asw}}
{{This is a|semi-internal=1|logical entity|name=light_directional|since=Left 4 Dead}}{{also|{{slamminsrc}}{{gmod}}}} It is a directional light with no falloff, similar to the direct lighting of {{ent|light_environment}}. The main difference between this and <code>light_environment</code> is that multiple of these can be used in a single map and all of them will cause light to be emitted from sky brushes based on each of their settings.


[[File:Multiple light directional.jpg|480px|thumb|right|Three light_directional entities in one map.<br>Note how the shadow colors are being changed by the additive behavior of the two other light entities.]]
{{note|As with a <code>light_environment</code>, a <code>light_directional</code> is only emitted from geometry covered with {{cmd|%CompileSkybox}} and {{cmd|%CompileSkybox2D}} textures.}}
{{bug|{{csgo}} In [[Counter-Strike: Global Offensive]], after the Wildfire update, this entity does not seem to be working properly or has to be set differently. It can create excessively dark shadows tinged with the color of the <code>light_environment</code> ambient color plus the setting of the <code>light_directional</code>. It appears to boost these colors tremendously now.}}
{{altnames|{{mono|[[light]]}}, {{mono|[[light_spot]]}}, {{mono|[[light_glspot]]}}, and {{l4d|since}}{{gmod|also}}{{mono|light_directional}} are all tied to the same C++ class in game, and only differ in VRAD.}}
{{codenote|See the {{asrd}}[https://github.com/ReactiveDrop/reactivedrop_public_src/tree/reactivedrop_beta/src/utils/vrad Alien Swarm Reactive Drop source code] for reference implementation of light_directional in VRAD.}}
== Keyvalues ==
== Keyvalues ==
{{KV targetname|light=1}}
:{{Light NameWarning}}
{{KV|Pitch|intn=pitch|integer|The downward pitch of the light from the sun. 0 is horizontal, -90 is straight down.}}
{{KV Angles}}
{{minititle|Internal keyvalues used only by [[VRAD]]}}
{{KV|Brightness|intn=_light|color255 + int|The RGB color and brightness of the light. Colors must be between 0 and 255; brightness can be anything.}}
{{KV|BrightnessHDR|intn=_lightHDR|color255 + int|Brightness override used in HDR mode. Default is <code>-1 -1 -1 1</code>, which means no change.
:{{warning|The fourth digit must be positive. Otherwise all light will be sucked out of your map!}}}}
{{KV|BrightnessScaleHDR|intn=_lightHDRscale|float|Amount to scale the light by when compiling for HDR.}}
{{KV|SpreadAngle|intn=SunSpreadAngle|float|The angular extent of the light for casting soft shadows. Higher numbers are more diffuse. 5 is a good starting value.}}


{{KV|Pitch|integer|The downward pitch of the light from the sun. 0 is horizontal, -90 is straight down.}}
== See also ==
{{KV|Brightness|color255|The RGB color and brightness of the light. Colors must be between 0 and 255; brightness can be anything.}}
* [[Lighting]]
{{KV|BrightnessHDR|color255|Brightness override used in HDR mode. Default is <code>-1 -1 -1 1</code>, which means no change. {{warning|The fourth digit must be positive. Otherwise all light will be sucked out of your map!}}}}
* [[List_of_entities#Light_Entities|Light entities]]
{{KV|BrightnessScaleHDR|float|Amount to scale the light by when compiling for HDR.}}
{{KV|SpreadAngle|float|The angular extent of the light for casting soft shadows. Higher numbers are more diffuse. 5 is a good starting value.}}
{{KV Angles}}


* [http://www.replicawatchesgrade.com/omega-c-131.html  '''Omega replica watches''']
[[Category:Lighting]]

Latest revision as of 08:13, 5 August 2025

C++ Class hierarchy
CLight
CPointEntity
CBaseEntity
C++ lights.cpp

light_directional is a semi-internal logical entity available in all Source Source games since Left 4 Dead Left 4 Dead.(also in Slammin' Source Map ToolsGarry's Mod) It is a directional light with no falloff, similar to the direct lighting of light_environment. The main difference between this and light_environment is that multiple of these can be used in a single map and all of them will cause light to be emitted from sky brushes based on each of their settings.

Three light_directional entities in one map.
Note how the shadow colors are being changed by the additive behavior of the two other light entities.
Note.pngNote:As with a light_environment, a light_directional is only emitted from geometry covered with %CompileSkybox and %CompileSkybox2D textures.
Icon-Bug.pngBug:Counter-Strike: Global Offensive In Counter-Strike: Global Offensive, after the Wildfire update, this entity does not seem to be working properly or has to be set differently. It can create excessively dark shadows tinged with the color of the light_environment ambient color plus the setting of the light_directional. It appears to boost these colors tremendously now.  [todo tested in ?]
AltNames.pngAltNames:light, light_spot, light_glspot, and (in all games since Left 4 Dead)(also in Garry's Mod)light_directional are all tied to the same C++ class in game, and only differ in VRAD.
Cpp.pngCode:See the Alien Swarm: Reactive DropAlien Swarm Reactive Drop source code for reference implementation of light_directional in VRAD.

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

Icon-Important.pngImportant:Naming a static light radically changes its behavior. See Naming Lights for details.
Pitch (pitch) <integer>
The downward pitch of the light from the sun. 0 is horizontal, -90 is straight down.
Pitch Yaw Roll (Y Z X) (angles) <QAngle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.

Internal keyvalues used only by VRAD:

Brightness (_light) <color255 + int>
The RGB color and brightness of the light. Colors must be between 0 and 255; brightness can be anything.
BrightnessHDR (_lightHDR) <color255 + int>
Brightness override used in HDR mode. Default is -1 -1 -1 1, which means no change.
Warning.pngWarning:The fourth digit must be positive. Otherwise all light will be sucked out of your map!
BrightnessScaleHDR (_lightHDRscale) <float>
Amount to scale the light by when compiling for HDR.
SpreadAngle (SunSpreadAngle) <float>
The angular extent of the light for casting soft shadows. Higher numbers are more diffuse. 5 is a good starting value.

See also