From Valve Developer Community
Revision as of 10:39, 24 April 2020 by Dr. Orange (talk | contribs) (Documented DISK type)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

<Black Mesa (Source)> env_lensflare is a point entity available in Black Mesa. It creates a lens flare that can be used to represent bright light sources.


File (FlareFile) <string>
Optionnal [sic] - file defining the lens flare. Note: Hammer's parameters overwrite the file's parameters.
Distance attenuation (FlareAttenuation) <float>
distance where lensflare will be invisible. 0.0 if not attenuation with distance
Flare Type (FlareType) <choices>
Normal: normal lens flare (Pitch,Yaw,Roll not used) ------ Sun Flare: set the same Pitch,Yaw,Roll that the one from the sun light_env. That will define the position of the sun. the actual position of this entity is not used.
  • 0: Normal
  • 1: Sun Flare
Appearance (FlareStyle) <choices>
Light Appearances
Literal Value Description Sequence Preview
0 Normal m Sequence 0.gif
10 Fluorescent flicker mmamammmmammamamaaamammma Sequence 10.gif
2 Slow, strong pulse abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba Sequence 2.gif
11 Slow pulse, noblack abcdefghijklmnopqrrqponmlkjihgfedcba Sequence 11.gif
5 Gentle pulse jklmnopqrstuvwxyzyxwvutsrqponmlkj Sequence 5.gif
1 Flicker A mmnmmommommnonmmonqnmmo Sequence 1.gif
6 Flicker B nmonqnmomnmomomno Sequence 6.gif
3 Candle A mmmmmaaaaammmmmaaaaaabcdefgabcdefg Sequence 3.gif
7 Candle B mmmaaaabcdefgmmmmaaaammmaamm Sequence 7.gif
8 Candle C mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa Sequence 8.gif
4 Fast strobe mamamamamama Sequence 4.gif
9 Slow strobe aaaaaaaazzzzzzzz Sequence 9.gif
12 !FGD Underwater light mutation mmnnmmnnnmmnn Sequence 12.gif
Size of Glow Proxy Geometry. (GlowProxySize) <float>
Size of the glow to be rendered for visibility testing. Must be larger than the distance from the sprite center to empty space. So if this glow is inside geometry (like a light bulb), set this value to be bigger than the bulb's radius. Any time a sphere of this radius would be visible (poking through any nearby geometry), the glow will be rendered. - Richard's note : I noticed that value more than ~100 wont work correctly
Flare 01 texture (Flare01_texture) to Flare 20 texture (Flare20_texture) <string>
image of the lens - if empty the flare doesn't exist
Flare 01 parameters (Flare01_params) to Flare 20 parameters (Flare20_params) <string>
parameters - example : DISK 1.0 10 10
Flare 01 intensity (Flare01_intensity) to Flare 20 intensity (Flare20_intensity) <vector>
intensity of the flare - example : 1.0 1.0 1.0
Flare 01 sizes (Flare01_sizes) to Flare 20 sizes (Flare20_sizes) <vector>
intensity of the flare - example : 1.0 1.0 1.0
Flare 01 color (Flare01_color) to Flare 20 color (Flare20_color) <color255>
color factor of the texture - example : 255 255 255


Classname (classname) <string>
The classname defines the type of entity. Classnames can be changed using AddOutput, which will influence how the engine deals with the entity in certain circumstances.
Name (targetname) <string>
The name that other entities refer to this entity by.
Global Entity Name (globalname) <string>
Name by which this entity is linked to another entity in a different map. When the player transitions to a new map, entities in the new map with globalnames matching entities in the previous map will have the previous map's state copied over their state.
Parent (parentname) <targetname>
Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma. Every entity can be parented, even point entities. Entities which are parented will be forced to transition to the next map, such as from a trigger_transition. Some entities which aren't intended to be parented may not function correctly. phys_constraint can be used as a workaround to parenting.
Origin (X Y Z) (origin) <coordinates>
The position of this entity's center in the world. Rotating entities typically rotate around their origin.
Pitch Yaw Roll (X Y Z) (angles) <angle>
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.
Note.png Note: This works on brush entities, although Hammer doesn't show the new angles.
Flags (spawnflags) <integer>
Toggles features of an entity, its specific number is determined by the combination of flags added.
Response Contexts (ResponseContext) <string>
Pre-defined response system contexts for this entity. Format is key:value,key:value,.... Contexts may be filtered.
Effects (effects) <integer> !FGD
Combination of effect flags to use.
Hammer ID (hammerid) <integer> !FGD
The entity's Hammer ID. Mainly used by plugins and debugging commands, such as ent_keyvalue. Can be manually assigned with the "hammerid" or "id" keyvalue. Entities spawned at run-time are not assigned any Hammer ID.
Entity Scripts (vscripts) <scriptlist> (in all games since <Left 4 Dead 2>)
Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.
Script think function (thinkfunction) <string> (in all games since <Left 4 Dead 2>)
Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call. Try to avoid expensive operations in this function, as it may cause performance problems.
Lag Compensation (LagCompensate) <boolean> (in all games since <Left 4 Dead 2>) !FGD
Set to Yes to lag compensate this entity. Should be used very sparingly!
Disable for Xbox 360 (disableX360) <boolean> (in all games since <Left 4 Dead 2>) !FGD
If this entity should automatically be given the 'Disable' input on the Xbox 360 version of Source.
Is Automatic-Aim Target (is_autoaim_target) <boolean> (in all games since <Counter-Strike: Global Offensive>) !FGD
If set to 1, this entity will slow down aiming movement for consoles and joystick controllers when the entity is under the crosshairs.


Sets the red color channel's value (0 - 255).
Sets the green color channel's value (0 - 255).
Sets the blue color channel's value (0 - 255).
Set the lensflare's scale (0 - 8.0).
Hide the lensflare. Won't be drawn until the 'ShowLensFlare' input is received.
Show the lensflare.
Toggle the lensflare between hidden and shown.


Removes this entity and any entities parented to it from the world.
Functions the same as Kill, although this entity and any entities parented to it are killed on the same frame, being marginally faster than Kill.
SetParent <string>
Move with this entity. See Entity Hierarchy (parenting).
SetParentAttachment <string>
Change this entity to attach to a specific attachment point on its parent. The entity will teleport so that the position of its root bone matches that of the attachment. Entities must be parented before being sent this input.
SetParentAttachmentMaintainOffset <string>
As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
Removes this entity from the the movement hierarchy, leaving it free to move independently.
AddOutput <string>
Evaluates a keyvalue/output on this entity.
Format: <key> <value>
Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1 to FireUser4
Fire the OnUser outputs; see User Inputs and Outputs.
Use  !FGD
Same as a player invoking +use; may not do anything. Can also be invoked by creating an output that does not specify an input.
This input is not included in Valve's FGDs.
DispatchEffect <string> (removed since <Left 4 Dead>) !FGD
Dispatches a special effect from the entity's origin. Removed and replaced entirely by the particle system since <Left 4 Dead>.
DispatchResponse <string> !FGD
Dispatches a response to the entity. See Response and Concept.
AddContext <string>
Adds to the entity's list of response contexts. Format is <key>:<value>.
RemoveContext <string>
Remove a context from this entity's list. The name should match the key of an existing context.
ClearContext <string>
Removes all contexts from this entity's list.
RunScriptFile <script> (in all games since <Left 4 Dead 2>)
Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
RunScriptCode <string> (in all games since <Left 4 Dead 2>)
Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console.
Bug.png Bug:  In <Left 4 Dead 2>, the code is executed in the script scope of the entity that fires the output, not the one receiving the input.
Warning.png Warning: Never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor.
CallScriptFunction <string> (in all games since <Left 4 Dead 2>) !FGD
Execute a VScript function in the scope of the receiving entity.
SetLocalOrigin <coordinates> (in all games since <Alien Swarm>) !FGD
Send this entity to a spot in the map. If the entity is parented to something, it will be offset from the parent by this amount.
SetLocalAngles <angles> (in all games since <Alien Swarm>) !FGD
Set this entity's angles.



OnUser1 to OnUser4
These outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 Input; see User Inputs and Outputs.


  •  [1] : Start on
  •  [2] : Play once

Lens Flare Properties

An individual env_lensflare can support up to 20 flares. Each flare have different properties that can be customized.


The texture property sets the material used by the flare. It is a path to a VMT file relative to the materials folder and without the file extension. Common flare materials are located in the effects/lensflare/ folder. Any material can be used as a lens flare, but flare materials should use UnlitGeneric and be additive.


The parameters property controls the appearance of the flare. Parameters take the following form: TYPE parameters

The following lens flare types can be used:


A screen space flare that gets stronger when the player looks directly at the env_lensflare, and weaker as the player looks away. It takes three parameters.

The first parameter scales the position of the flare on screen. When it is 0 the flare stays at the env_lensflare's screen space position. When it's greater than zero and less than one it will stay between the center of the player's screen and the env_lensflare's on screen position. When it is equal to one the flare will stay at the center of the screen. When greater than one the flare will get further away from the env_lensflare's screen space position the more the player looks away from the env_lensflare.

The second and third parameters is the size of the flare in the x- and y-axis respectively.

To do: Document lens flare properties