light_surface

Modified

12-Jul-2023

Allows you to create texture lights (textures that emits lights) in more advanced way than info_texlights does. All keyvalues set to default, change "Texture Name" keyvalue and it will emit light of this texture color and power of 80. All other keyvalues and flag are optional.

Keyvalues


Texture name _tex : Name of texture to emit light.

Filter max distance _frange : Excludes faces whose centers are far from this light_surface.

Filter max dist to plane _fdist : Same as above, but checking the distance to the whole texture plane (instead of face center).

Filter entity classname _fclass : Same as "Class In Filter" with filter type.

Filter entity name _fname : Same as "Name In Filter" with filter type.

Texture brightness _light : The brightness of texture. Works the same way as in light and light_spot.

Color(replace texture color) _texcolor : Leave it empty, so color is auto-generated based on texture color.

Inner(bright) angle(90default) _cone : Like in light_spotlight, custom values used to simulate spotlight.

Outer(fading) angle(90default) _cone2 : Like in light_spotlight, custom values used to simulate spotlight.

Adjust emit scale(1.0default) _scale : When simulating light_spotlight, this is scale value for light emission.

Grid size of sampling _chop : Grid size of sampling. However lightmap grid cannot be changed. This keyvalue functionality is very limited.

Dark gap in front of texlight _texlightgap : Moves lights out of texture by few units (specified amount or chosen from pre-definied values). It's useful in situations where light leaking out of the brush in opposite direction of light. Example:

  • "" : Default (no gap)
  • "0.0" : 0.0 - no gap
  • "3.0" : 3.0 - small gap
  • "12.0" : 12.0 - large gap

Fast _fast : Determines usage of '-fast' compile parameter for light. Set it to 'Yes' if brightness is low and the face is large.

  • "" : Auto
  • 1 : Yes
  • 2 : No

Classname in game convertto : Used by compilers. You don't need to set this.

  • "light" : light
  • "light_spot" : light_spot

Name targetname : Set name of light_surface so other entities can trigger it to turn texture lights on and off. Depending on trigger use-type: 'On'- turn light on, 'Off'- turn light off, 'Toggle'- toggle light. Kill-targeting this entity will remove light_surface but won't remove lightstyles (you might want to just turn it off instead).

Appearance (no name allowed) style : Allows you to select a light style.

  • "" : Normal
  • 10 : Fluorescent flicker
  • 2 : Slow, strong pulse
  • 11 : Slow pulse, no black
  • 5 : Gentle pulse
  • 1 : Flicker A
  • 6 : Flicker B
  • 3 : Candle A
  • 7 : Candle B
  • 8 : Candle C
  • 4 : Fast strobe
  • 9 : Slow strobe
  • 12 : Underwater mutation

Custom Appearance pattern : Allows you to set up a custom appearance of light. To do this, you will have to enter 1 to 64 chars from the alphabet ('a' to 'z'), whereas 'a' stands for being dark and 'z' for very bright. Normal lights' appearances uses 'm'. The program Custom Lightstyle Generator by Craig "CRAZG" McLaren might help you here. Whatever sequence you enter is stepped through at about 8 Hertz. This will only work when a targetname is set. Note that there can be at most 4 different light styles affecting a face in your map. Otherwise, light styles will be discarded from it, causing unrealistic lighting in extreme cases.

Flags


  • 1 : Initially dark : If set, the light emmited from textures will be turned off at map start. This will only work when a targetname is set. This counts as an additional lightstyle. If you have multiple lights by the same name, they will count as one additional lightstyle, even if some of the lights are initially dark while others are not. Note that there can be at most 4 different light styles affecting a face in your map. Otherwise, light styles will be discarded from it, causing unrealistic lighting in extreme cases.

  • 2048 : Not in Deathmatch : Obsolete in Sven Co-op. Makes the entity don't appear in Multiplayer Games.

The brightness does not work in the same way as in the "info_texlight" (it does not scale with texture size) so you don't need to multiply "Texture brightness" value to achieve sufficient brightness.

When you want to set some of the values to '0', you'll need to set them to '0.0' instead. Editor ignores raw '0' value.