Naming Lights: Difference between revisions
MyGamepedia (talk | contribs) No edit summary |
SirYodaJedi (talk | contribs) (seems like lightmapped props don't recieve named lights) |
||
Line 14: | Line 14: | ||
{{bug|since=l4d|There is a bug in the {{l4d|4}} engine that affect the use of named lights. A named light, even if totally still will be considered fully dynamic by the engine and pump up a large chunk of frames per second until it is turned off and on for the first time. The workaround is to set the light to start turned off and to turn it on on map spawn using a {{ent|logic_auto}} entity for instance. This could also affect {{l4d2|4}}, but this has not been proven.}} | {{bug|since=l4d|There is a bug in the {{l4d|4}} engine that affect the use of named lights. A named light, even if totally still will be considered fully dynamic by the engine and pump up a large chunk of frames per second until it is turned off and on for the first time. The workaround is to set the light to start turned off and to turn it on on map spawn using a {{ent|logic_auto}} entity for instance. This could also affect {{l4d2|4}}, but this has not been proven.}} | ||
{{Warning|Although lights with the same targetname share lightmap pages, each light will still count as a separate [[edict]]! If using a bunch of lights with a shared name, consider removing the targetname from all but one of the light entities of a given name after compiling lighting, using a tool such as {{teamspen|2}} or {{entspy|2}}.}} | {{Warning|Although lights with the same targetname share lightmap pages, each light will still count as a separate [[edict]]! If using a bunch of lights with a shared name, consider removing the targetname from all but one of the light entities of a given name after compiling lighting, using a tool such as {{teamspen|2}} or {{entspy|2}}.}} | ||
{{confirm|[[Lightmapped props]] seem to always treat named lights as being "off". If this is the case, it can be worked around by using [[$lightmap]] (with the light unnamed for baking the "on" frame), using [[skin]]s on a [[prop_dynamic]] to toggle between on and off.}} | |||
== See also == | == See also == |
Revision as of 20:25, 7 September 2024


Giving a light entity a targetname makes VRAD compile a second lightmap "page" for the surfaces that its emitted light touches. This won't harm in-game performance, but it will increase compile time and BSP filesize, regardless of whether the light ever receives input to change its state.
However, the system can be overloaded if you try to make it handle a large number of overlapping named lights (since the number of pages needed increases exponentially). When this happens performance can be harmed and you may well see lighting anomalies.
VRAD attempts to avoid this with its hard-coded limits of two switchable lights affecting a brush face and 32 total pages per lightmap (a page exists for each possibility of combined states). More than this causes VRAD to throw a warning such as "Too many light styles on a face" and refuse to compute the lightmaps for those lights; this will make those areas appear as if they are not lit. You can help too by giving lights that will always change state at the same time a shared targetname, which makes VRAD merge their pages together.












