Naming Lights: Difference between revisions
SirYodaJedi (talk | contribs) No edit summary |
SirYodaJedi (talk | contribs) No edit summary |
||
Line 9: | Line 9: | ||
{{tip|If your game supports dynamic lighting system ({{bms|4}} or {{p2d|4}} for example) - use dynamic light sources instead of {{ent|light}} and {{ent|light_spot}}. This will reduce map size and make load times better. Don't do so in cases when dynamic light looks much worse then baked light, or when dynamic light causes big problems with performance.}} | {{tip|If your game supports dynamic lighting system ({{bms|4}} or {{p2d|4}} for example) - use dynamic light sources instead of {{ent|light}} and {{ent|light_spot}}. This will reduce map size and make load times better. Don't do so in cases when dynamic light looks much worse then baked light, or when dynamic light causes big problems with performance.}} | ||
{{note|Light styles will affect page growth exponentially. To calculate the number of pages a brush face will have, take 2<sup>n</sup> where n is the number of named lights affecting the brush face.}} | {{note|Light styles will affect page growth exponentially. To calculate the number of pages a brush face will have, take 2<sup>n</sup> where n is the number of named lights affecting the brush face.}} | ||
{{note|To reduce the number of pages created, light from named light entities is direct and won't bounce between surfaces. This can look very crude! {{fix|{{gmod}} [[VRAD]] has a {{code|-bounceFromNamed}} parameter that can force named and styled lights to cast bounced lighting. Note that this ''will'' increase lightmap usage!}} | {{note|To reduce the number of pages created, light from named light entities is direct and won't bounce between surfaces. This can look very crude! {{fix|{{gmod}} [[VRAD]] has a {{code|-bounceFromNamed}} parameter that can force named and styled lights to cast bounced lighting. Note that this ''will'' increase lightmap usage!}} }} | ||
{{note|Setting an [[lightstyle|animated appearance]] for the light counts as naming it.}} | {{note|Setting an [[lightstyle|animated appearance]] for the light counts as naming it.}} | ||
Revision as of 12:34, 26 March 2025


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.














