This article's documentation is for the "GoldSrc" engine. Click here for more information.

Light environment (GoldSrc): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Added entity page)
 
(-added class hierarchy)
 
(18 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{back|List of HL1 entities}}
{{LanguageBar}}
{{GoldSource base point|light_environment}}
{{CD|CEnvLight|goldsrc=1}}
{{TabsBar|main=gs2|base=Light environment}}
{{this is a|point entity|name=light_environment|engine=GoldSrc}}


== Description ==
== Description ==
Line 6: Line 8:


== Key values ==
== Key values ==
; Pitch <code><[[QAngle|angle]]></code>
{{todo|Document {{code|_diffuse_light}} and {{code|_spread}}, added with [[ZHLT]], and {{code|_diffuse_light2}}, added with [[VHLT]].}}
: Overrides the pitch value in Angles, even if left at 0, so it needs to be specified. Contrary to Angles, the rotation of this pitch is measured counter-clockwise from the horizontal, so that 90 is straight up, while -90 is straight down. (It's simply the negative of a normal pitch value.)
{{Hl1 kv targetname|light=1}}
; Brightness <code><[[color255]] + [[int]]></code>
: Color and brightness of direct Sunlight.
{{Hl1 kv targetname}}
{{KV Angles}}
{{KV Angles}}
{{Hl1 kv zhlt point}}
{{KV|Pitch|intn=pitch|angle|Overrides the pitch value in Angles, even if omitted, so it ''needs'' to be specified. Contrary to Angles, the rotation of this pitch is measured ''counter''-clockwise from the horizontal, so that ''90'' is straight up, while ''-90'' is straight down. (It's simply the negative of a normal pitch value.)}}
{{hl1 kv light}}
{{Hl1 kv zhlt light source|sun=1}}


[[Category:Half-Life Entities]]
[[Category:Half-Life Entities]]
[[Category:Half-Life]]
[[Category:Half-Life]]
[[Category:Lighting]]
[[Category:Lighting]]

Latest revision as of 17:22, 7 May 2025

English (en)Translate (Translate)
C++ Class hierarchy
CEnvLight
CLight
CPointEntity
CBaseEntity
C++ lights.cpp

light_environment is a point entity available in all GoldSrc GoldSrc games.

Description

Creates the sunlight emitted from sky brushes. There needs to be one per PVS if using the default compile tools. Only one is needed per map if using the ZHLT compile tools.

Key values

Todo: Document _diffuse_light and _spread, added with ZHLT, and _diffuse_light2, added with VHLT.
Name (targetname) <string>
The targetname that other entities refer to this entity by.
Icon-Important.pngImportant:Naming a static light radically changes its behavior. See Naming Lights for details.
Pitch Yaw Roll (Y Z X) (angles) <QAngle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
Pitch (pitch) <angle>
Overrides the pitch value in Angles, even if omitted, so it needs to be specified. Contrary to Angles, the rotation of this pitch is measured counter-clockwise from the horizontal, so that 90 is straight up, while -90 is straight down. (It's simply the negative of a normal pitch value.)

Light:

Color + Brightness (_light) <color255 + int>
The RGB color and brightness of the light. Colors must be between 0 and 255; brightness can be anything.
Note.pngNote:Negative brightness will suck out the amount of lighting that the equivalent positive brightness would cast.
Appearance (lightstyle) (style) <choices>
Various lightstyle presets. Cannot be used on named lights.
Lightstyle presets (epilepsy warning)
Literal Value Description Sequence Preview
0 Normal m Lightstyle 0.png
10 Fluorescent flicker mmamammmmammamamaaamammma Lightstyle 10.gif
2 Slow, strong pulse abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba Lightstyle 2.gif
11 Slow pulse, noblack abcdefghijklmnopqrrqponmlkjihgfedcba Lightstyle 11.gif
5 Gentle pulse jklmnopqrstuvwxyzyxwvutsrqponmlkj Lightstyle 5.gif
1 Flicker A mmnmmommommnonmmonqnmmo Lightstyle 1.gif
6 Flicker B nmonqnmomnmomomno Lightstyle 6.gif
3 Candle A mmmmmaaaaammmmmaaaaaabcdefgabcdefg Lightstyle 3.gif
7 Candle B mmmaaaabcdefgmmmmaaaammmaamm Lightstyle 7.gif
8 Candle C mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa Lightstyle 8.gif
4 Fast strobe mamamamamama Lightstyle 4.gif
9 Slow strobe aaaaaaaazzzzzzzz Lightstyle 9.gif
12 Underwater light mutation mmnnmmnnnmmnn Lightstyle 12.gif
63 Testing (Off) !FGD a Lightstyle 63.png
Custom Appearance (pattern) <string>
A string of english letters, like a sequence of piano keys, that define a pattern of brightness. a is 0%, m is 100%, and z is 200%. Updates at 10 Hz. Requires light to have a targetname.

ZHLT light source:

ZHLT Fade <float>
ZHLT Falloff <integer>
  • 0 : Default
  • 1 : Inverse Linear
  • 2 : Inverse Square
Texlight (VHLT+) (_tex) <texture>
HLCSG will rename this entity to light_surface, using the specified texture as the emissive texture. See light_surface page for additional relevant KVs.
Ambient (ZHLT+) (_diffuse_light) <color255 + int>
Ambient 2 (ZHLT+) (_diffuse_light2) <color255 + int>
Sun spread angle (_spread) <integer>
Model lighting only (VHLT v16+) (_fake) <boolean>
Treat this entity as an info_sunlight, causing it to not affect lightmaps.