Env projectedtexture: Difference between revisions
Jump to navigation
Jump to search
Note:In Garry's Mod, there can be up to 8 active env_projectedtextures turned on with shadow mapping at a time. You can also increase this limit by putting
Tip:If your options menu does not show the "High" shadow detail setting by default, you can add
Bug:The configurable texture value from Hammer is not accepted - will always default to the flashlight. You must use the
Note:The
Bug:The entity cannot target another entity. See env_projectedtexture/fixes#Fixing targeting. [todo tested in ?]
Note:In Source 2007/2009, only
(Added a mention about Garry's Mod ability to have up to 8 shadow maps active, and also added a mention about the -numshadowtextures command parameter, and few minor things.) |
|||
Line 2: | Line 2: | ||
[[File:Global_shadow_mapping.jpg|thumb|[[Portal 2]] uses projected textures extensively for world lighting.]] | [[File:Global_shadow_mapping.jpg|thumb|[[Portal 2]] uses projected textures extensively for world lighting.]] | ||
{{base point|env_projectedtexture|since=Half-Life 2: Episode Two}} It projects a [[texture]] as a dynamic light that affects all objects in the world, optionally with [[Wikipedia:Shadow mapping| | {{base point|env_projectedtexture|since=Half-Life 2: Episode Two}} | ||
== Entity description == | |||
It projects a [[texture]] as a dynamic light that affects all objects in the world, optionally with [[Wikipedia:Shadow mapping|Shadow Mapping]]. | |||
== Caveats == | == Caveats == | ||
* Valve's games only support one shadow map at a time. [[env_projectedtexture/fixes|Mods can remove this limit.]] | * Valve's games only support one shadow map at a time. [[env_projectedtexture/fixes|Mods can remove this limit.]] | ||
{{Note|In [[Garry's Mod]], there can be up to 8 active env_projectedtextures turned on with shadow mapping at a time. You can also increase this limit by putting <BR><code>-numshadowtextures #</code> in the Steam launch parameters of Garry's Mod, where # is the number of shadow maps the game should allow.}} | |||
* Shadows are only rendered when the user is running with "High" shadow detail. | * Shadows are only rendered when the user is running with "High" shadow detail. | ||
{{Tip|If your options menu does not show the "High" shadow detail setting by default, you can add <code>-force_vendor_id 0x10DE -force_device_id 0x1180</code> to the game's launch options for it to show up.}} | {{Tip|If your options menu does not show the "High" shadow detail setting by default, you can add <code>-force_vendor_id 0x10DE -force_device_id 0x1180</code> to the game's launch options for it to show up.}} | ||
Line 70: | Line 73: | ||
{{IO|AlwaysUpdateOn|Turn on per frame updating (for moving lights)|since=AS}} | {{IO|AlwaysUpdateOn|Turn on per frame updating (for moving lights)|since=AS}} | ||
{{IO|AlwaysUpdateOff|Turn off per frame updating (for moving lights)|since=AS}} | {{IO|AlwaysUpdateOff|Turn off per frame updating (for moving lights)|since=AS}} | ||
{{IO|EnableShadows|Set the if shadows are enabled|param=bool | {{IO|EnableShadows|Set the if shadows are enabled|param=bool}} | ||
{{IO|LightColor|Change the light color/brightness|param=color255|since=AS}} | {{IO|LightColor|Change the light color/brightness|param=color255|since=AS}} | ||
{{IO|SetLightStyle|Change the lightstyle. (see Appearance keyvalue above for possible values)|param=integer|since=P2}} | {{IO|SetLightStyle|Change the lightstyle. (see Appearance keyvalue above for possible values)|param=integer|since=P2}} |
Revision as of 23:58, 28 July 2017

Portal 2 uses projected textures extensively for world lighting.
Entity description
It projects a texture as a dynamic light that affects all objects in the world, optionally with Shadow Mapping.
Caveats
- Valve's games only support one shadow map at a time. Mods can remove this limit.

-numshadowtextures #
in the Steam launch parameters of Garry's Mod, where # is the number of shadow maps the game should allow.- Shadows are only rendered when the user is running with "High" shadow detail.

-force_vendor_id 0x10DE -force_device_id 0x1180
to the game's launch options for it to show up.- In multiplayer, mp_flashlight and mat_supportflashlight must be set to 1 for flashlights to work. By default these ConVars are disabled in Team Fortress 2, so this entity won't work there without special configuration.
- Viewmodels won't receive light or shadows from projected textures. See the code fix available.
Source 2007/2009 bugs
These have all been fixed in more recent engine builds.

SpotlightTexture
input or use the code fix available on the Bug Fixes page. [todo tested in ?]
SpotlightTexture
input has been disabled in the Portal 2 and CS:GO engines, and instead shows an error message: "SetSpotlightTexture is disabled. If you need this feature reimplemented, tell a programmer."
Keyvalues
- Target ([todo internal name (i)]) <targetname>
- The entity will rotate to point at its target, no matter where it is in the world. Make sure you check the "Always update" flag if you set this.
- 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°.Bug:This Input does not work in Alien Swarm. [todo tested in ?]
- 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.
- 0 : Low (sharp, pixelized shadows)
- 1 : High (smooth edged shadows)
- Light Only Target ([todo internal name (i)]) <boolean>
- Limit flashlight effect to only effect target entity. 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. Higher numbers cause faster transitions.
- Texture Name ([todo internal name (i)]) <string> (in all games since
)
- The texture or material which this entity projects.
- Appearance ([todo internal name (i)]) <choices> (in all games since
)
- Various Custom Appearance (see below) presets.
- 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.
Appearances
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. If two env_projectedtextures with the same name are turned on, both will theoretically be on. However, source limits the number of env_projectedtexture's rendered at a time to one. So, if the player is viewing the first light and then views the second, the first will turn off and the second will remain on.
- 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)
- EnableShadows <boolean >
- Set the if shadows are enabled
- 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.