Env projectedtexture
Jump to navigation
Jump to search

Projecting a colourful texture.

Env_projectedtextures allow for self-shadows, shadow-receivers, and properly oriented and proportioned shadows. Two of these entities are currently being used in this scene. After "grain" fix
Entity description
It creates a dynamic shadow-mapping light that affects all objects in the world. It is used to create the flashlights in Source 2007, Source 2009 and Left 4 Dead engine games. In Alien Swarm and Portal 2, it is also used for world lighting in combination with static lights.



SpotlightTexture
input or use the code fix available on the Bug Fixes page. [todo tested in ?]
Portal 2 improvements

Example of the improved texture projection in Portal 2.
As expected, projected textures have been improved in Portal 2. Light no longer bleeds around objects and shadows appear to be more accurate and precise. In addition, more flashlight ConVars are available (try find r_flashlight in the console).

Bug fixes
See env_projectedtexture/fixes.
Keyvalues
- target ([todo internal name (i)]) <targetname>
- The entity will rotate to point at its target, no matter where it is in the world. See also
lightonlytarget
.Bug:Does not work with stock SDK code. See Env_projectedtexture/fixes#Fixing targeting. [todo tested in ?]
- FOV ([todo internal name (i)]) <float>
- The field of view angle at which the texture is projected. The projection is square, but the texture can make it appear of any shape.
Remember the default Player FOV is 75°.
- NearZ ([todo internal name (i)]) <float>
- Near Z for projected texture. Default value is 4.0.
Objects closer than this will not receive the projection.
- FarZ ([todo internal name (i)]) <float>
- Far Z for projected texture. Default value is 750.0.
Objects beyond this distance will not receive the projection. Think of it as the range limit.
- Enable Shadows ([todo internal name (i)]) <boolean>
- Enables/disables shadows from this projected texture.
- Shadow Quality ([todo internal name (i)]) <choices>
- Quality of shadows. (Todo: what's the difference?)
- 0 : Low
- 1 : High
- Light Only Target ([todo internal name (i)]) <boolean>
- Limit flashlight effect to only effect target entity?
Note:The world will still be lit.
- Light World ([todo internal name (i)]) <boolean>
- Control whether flashlight effects static world geometry.
- Camera Space ([todo internal name (i)]) <integer>
- Display relative to player's view. Breaks things horribly unless the entity moves with the player.
- Brightness Scale ([todo internal name (i)]) <float> (in all games since
)
- Scale the light color by this brightness.
- Color Transition Time ([todo internal name (i)]) <float> (in all games since
)
- Amount of time it takes for a color change to occur.
- Texture Name ([todo internal name (i)]) <material> (in all games since
)
- Sets the current projected texture associated with this entity.
Bug:Does not work with stock SDK code. See Env_projectedtexture/fixes#Fix configurable texture value in Hammer. [todo tested in ?]
- Appearance ([todo internal name (i)]) <choices> (in all games since
)
- Various Custom Appearance (see below) presets.
Value Description 0
Normal 10
Fluorescent flicker 2
Slow, strong pulse 11
Slow pulse, noblack 5
Gentle pulse 1
Flicker A 6
Flicker B 3
Candle A 7
Candle B 8
Candle C 4
Fast strobe 9
Slow strobe
- Custom Appearance ([todo internal name (i)]) <string> (in all games since
)
- Set a custom pattern of light brightness for this light. Pattern format is a string of characters, where a is total darkness, z fully bright. i.e.
aaggnnttzz
would be a steppy fade in from dark to light.
- Name (targetname) <string>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentname
ortarget
).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
Parentname:
- 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.
Bug:Does not work with stock SDK code. See Env_projectedtexture/fixes#Fixing Parenting. [todo tested in ?]
- 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.
Flags
- 1 : Enabled
- 2 : Always Update (moving light) Template:AS add
Inputs

TurnOn
, TurnOff
and SetFOV
are known to Hammer.
- TurnOn
- Turn on the texture.
- TurnOff
- Turn off the texture.
- SetFOV <float >
- Set FOV. See lightfov keyvalue above.
- SpotlightTexture <string >
- Set the spotlight texture. Must be a VTF file (not VMT), relative to
/materials
.
- Target <string >
- Specify a new target entity to point at.
- CameraSpace <boolean >
- See above keyvalues.
- Ambient <boolean >
- Allows for an ambiance light, much like the shadow color for it.
- AlwaysUpdateOn (in all games since
)
- Turn on per frame updating (for moving lights)
- AlwaysUpdateOff (in all games since
)
- Turn off per frame updating (for moving lights)
- SetLightStyle <integer > (in all games since
)
- Change the lightstyle. (see Appearance keyvalue above for possible values)
- SetPattern <string > (in all games since
)
- Set a custom pattern of light brightness for this light. (see Custom Appearance keyvalue above)
Parentname:
- 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.
- ClearParent
- Removes this entity from the the movement hierarchy, leaving it free to move independently.