Template:Archived Page History/Light dynamic/en: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Replaced gif with video.)
(Replaced content with "{{APH|light_dynamic}}")
Tag: Replaced
Line 1: Line 1:
 
{{APH|light_dynamic}}
[[Category:TODO Finish Multipage Removal Manually]]
{{LanguageBar}}
{{this is a|point entity|name=light_dynamic|sprite=light.png}}
{{CD|CDynamicLight|file1=dynamiclight.cpp}}
It is an invisible light source that changes over time, casting [[dlight]]s on brushes and [[elight]]s on models. Can be turned on and off through inputs, and can aim at any object, including moving ones. Dynamic lights are calculated on the fly in the game, which means they have a higher processing cost but are much more flexible than static lighting. It is also the only entity except
{{ent|env_projectedtexture}} that can light up brushes in real-time (but it doesn't replace their original lighting).
 
{{clr}}
 
{{note|This entity actually consists of two lights, a cone model light and a spot world light.  Some values may affect one and not the other.}}
 
{{note|For the light to work properly, the "'''Maximum distance'''" keyvalue must be greater than the distance from the entity to the surface it is supposed to light, otherwise it will not show. Also, it is recommended to set the "'''Light brightness'''" keyvalue to either 6 or 8 as it typically looks best. Normal brightness values do not apply. Finally, adjusting the angle using the circle tool in the top-right or by using the "point at" tool will only adjust the cone model, the angle keyvalue must be set manually to adjust the spot world light.}}
 
{{note|For the 2013 SDK this is limited to 32 lights on at any one time so use wisely. }}
 
{{note|For spotlights, it is recommended to use [[Env projectedtexture|env_projectedtexture]] for more realistic and accurate dynamic lighting.}}
{{bug|Parented light_dynamic entities may not correctly light brushes; see [[Talk:light_dynamic#Parent|the talk page]].}}
{{warning|This entity reduce performance, especially with small luxel scale for lightmaps and custom appearance. For example, in {{bms12|4|nt=2}} turrets make 30-40 FPS in some cases when fire, however in {{bms|4|nt=2}} this entity use {{wiki|Deferred lighting}}, which does not cause performance problems in the cases.}}
{{important|While this entity does exist in {{bms|4}}, it is very different from other games. Instead of using [[lightmap]]s it uses {{wiki|Deferred lighting}}. However, unlike Black Mesa's new lighting entities, it ''does not'' support specular reflections and dynamic shadows. This entity is used for some effects and entities, such as [[prop_flare]] or [[npc_alien_controller]]. Many inputs are missing, except TurnOff, TurnOn, Toggle and base entity inputs. Console commands (see below) for this entity don't work. Essentially this is cheap analogue of a {{ent|newLight_Point}}.}}
[[File:lightdynamic.jpg|thumb|right|300px|An example Light_dynamic with different colors]]
[[File:lightdynamicBMS.png|thumb|right|300px|An example in {{bms|4}}]]
 
 
== Keyvalues ==
{{KV Targetname}}
{{KV|Entity to point at|intn=target|target_destination|The name of an entity in the map that the dynamic light will point at.}}
{{KV|Light color|intn=_light|color255|The RGB render color of the spotlight. Colors must be between 0 and 255.}}
{{KV|Light brightness|intn=brightness|integer|The intensity of the spotlight.}}
{{KV|Inner (bright) angle|intn=_inner_cone|integer|The angles of the inner spotlight beam. 0 makes it omnidirectional.}}
{{KV|Outer (fading) angle|intn=_cone|integer|The angles of the outer spotlight beam. 0 makes it omnidirectional.}}
{{bug|Broken in {{bms|4}}, always use 0 value.}}
The bug [https://www.youtube.com/watch?v=OVcTpMZaAm0 example].
{{KV|Pitch|intn=pitch|integer|Used instead of Pitch Yaw Roll's value for reasons unknown. }}
{{KV|Maximum distance|intn=distance|float|This is the distance that light is allowed to cast, in inches.}}
{{KV|Spotlight end radius|intn=spotlight_radius|float|This is the radius of the light, in inches, at the object that it is hitting.}}
{{KV|Appearance|intn=style|choices|Various Custom Appearance ([[#Appearances|see below]]) presets.}}
{{light appearances}}
 
== Flags ==
{{Fl|1|Do not light [[worldspawn|world]] (better perf)}}
{{note|Doesn't work in {{bms|4}}.}}
{{Fl|2|Do not light models}}
{{note|Doesn't work in {{bms|4}}.}}
{{Fl|4|Add [[Displacement#Blended_displacement_materials_.28alpha_channel_painting.29|Displacement Alpha]]}}
{{warning|If enable - light source will not work in {{bms|4}}.}}
{{Fl|8|Subtract Displacement Alpha}}
{{note|Doesn't work in {{bms|4}}.}}
 
==Inputs==
{{IO|Color|Set the light's render color (R G B).|param=color255}}
{{note|Not missed in {{bms|4}}, but it does nothing.}}
{{IO|brightness|Set the light brightness.|param=integer}}
{{IO|distance|Set the maximum light distance.|param=float}}
{{IO|_inner_cone|Set the inner (bright) angle.|param=integer}}
{{IO|_cone|Set the outer (fading) angle.|param=integer}}
{{IO|spotlight_radius|Set the radius of the spotlight at the end point.|param=float}}
{{IO|style|Change the lightstyle (see Appearance field for possible values).|param=integer}}
{{IO|TurnOn|Turn the light off.}}
{{IO|TurnOff|Turn the light on.}}
{{IO|Toggle|Toggle the light on/off.}}
 
== Console commands ==
{{IO|r_dynamic|param=bool|Enables dynamic lights.}}
{{IO|r_dynamiclighting|param=bool|Enables [[Naming Lights|toggled lights]].}}
{{IO|r_maxdlights|param=int|Sets the maximum amount of dynamic lights.}}
{{IO|r_portal_use_dlights|param=int|Enables dynamic lights behind portals|only={{portal2}}}}
 
== See also ==
* {{ent|Light_deferred}}
* [[Lighting]]
*  {{ent|newLight_Point}}
* {{ent|newLight_Spot}}
* [[List_of_entities#Light_Entities|Light entities]]
 
[[Category:Lighting]]

Revision as of 04:01, 13 July 2024

Note.pngNote:Archived rest of page history of page light_dynamic
Icon-Important.pngImportant:These pages are linked often from page history logs so Special:WhatLinksHere will not show anything.