light_spot
Last edited 2 months ago2024-09-13 07:15:10 UTC
- Wiki
- View Page
-
You are viewing an older revision of this wiki page. The current revision may be more detailed and up-to-date.
Click here to see the current revision of this page.
The
light_spot
entity allows you to create a directed cone of light (like from a flashlight, spotlight, projector, and beacon) rather than spreading
light
in all directions.
Attributes
- Name (targetname) - Property used to identify entities.
- Pitch Yaw Roll (angles) - Sets the pitch (up / down), yaw (left / right) and roll (bank) respectively. The compass in WorldCraft / Hammer corresponds to Yaw. The light emitted by this entity will be directed this way.
- Target (target) - The light will point at this target during compile. Overrides angles. Using
info_null
as target is preferred.
- ZHLT Fade (_fade) - It darkens the light as the value increases.
- ZHLT Falloff (_falloff) - Light calculation falloff. [🚫Feature removed in default VHLT builds] Values:
- 0 = Default (Defer to global falloff, which defaults to 2 i.e. Inverse Square)
- 1 = Inverse Linear
- 2 = Inverse Square (Default; more akin to real-world light calculation)
- Inner Radius (_cone) - The angle of the cone formed around the directional axis. The area inside this cone will contain the brightest light.
- Outer Radius (_cone2) - Similar as above, although the area inside this cone will fade increasingly towards the outer edges.
- Pitch (pitch) - The pitch of the light (-90 is straight down, 90 is straight up). Overrides pitch value in angles.
- Brightness (_light) - First three 3-digit numbers are the color (RGB). The fourth number is the brightness, and can go above 255. e.g.
255 0 0 300
will produce a red light with a brightness of 300 units.
- Is Sky (_sky) - 0=No, 1=Yes. If Yes, the
light_spot
entity will act like a light_environment
, casting parallel beams of light from sky brushes in the map rather than itself.
- Appearance (style) - Light appearance. Values:
- 0 = Normal
- 1 = Flicker A
- 2 = Slow strong pulse
- 3 = Candle A
- 4 = Fast strobe
- 5 = Gentle pulse
- 6 = Flicker B
- 7 = Candle B
- 8 = Candle C
- 9 = Slow strobe
- 10 = Fluorescent flicker
- 11 = Slow pulse, no black
- 12 = Underwater mutation (i.e. constant light source, but placed underwater)
- Custom Appearance (pattern) - Use a string of letters to provide a custom light style (see note).
Flags
- Initially dark (1) - If this is enabled, the entity will need to be triggered to work.
Notes
On light entities in general
- Naming the light will make it ignore its Appearance (style). To get around this, use Custom Appearance (pattern) instead (in particular, the linked page has pattern strings used by the preset appearance values).
- The Custom Appearance (pattern) property allows you to enter a string of up to 63 letters from a to z, representing brightness. If you entered 'abcdefghihgfedcba' then the light would go from bright to dim and back again and then repeat. To use this feature, you must name the light.
- There's a limit of 4 light styles for any given face in the BSP format. Each different light Appearance (style), and each unique name on
light*
entities, is a different light style, so you want to be careful not to place a lot of lights with differing styles/names in the same area.
- There's a limit of 31 uniquely named lights per map. This includes all
light*
entities.
- Light from a
light_environment
entity overrides lighting on entity models if the entities have line of sight to the sky (i.e. sky faces) from the reverse direction of the angles/angle+pitch values of that light_environment
entity.
- To block line of sight and have entities take lighting from the ground as normal, use brushes textured with black_HIDDEN on the bottom face, and SKIP on the other faces.
- To bypass this effect altogether, use
light_spot
(this entity) with "Is Sky" set to Yes instead of light_environment
.
- Click this link for more information.
- Tip: Pair light entities with light fixtures so that the light appear more lifelike instead of emanating out of thin air.
- ⚠️ The ZHLT Falloff (_falloff) feature has been removed in default VHLT builds. To check that your RAD compiler has it, run the program without arguments and see if
-falloff
is listed in the help screen output. It should be right below -fade
.
On light_spot
entities
- The key pitch have the same function as the one in angles, although if you add a value (≠0) to pitch it will overwrite the one in angles. Roll has no effect at all.
- Using a target overrides both pitch and angles values.
- Angles above 90 degrees for _cone and _cone2 have no effect. This means that no shadow can be formed beyond the range of 180 degrees (referred by angles/pitch) around this entity.
- The lighting from
light_spot
is fixed and baked into the map. It doesn't follow the target entity in game.
- Using
info_null
as target is preferred as it removes itself on map start to free up edicts.
Related pages
Comments
You must log in to post a comment.
You can login or register a new account.