Env projectedtexture: Difference between revisions
Jump to navigation
Jump to search
(updated) |
TomEdwards (talk | contribs) No edit summary |
||
Line 7: | Line 7: | ||
Creates a dynamic shadow-casting light that affects all objects in the world. Used for the [[Episode Two]] flashlight. | Creates a dynamic shadow-casting light that affects all objects in the world. Used for the [[Episode Two]] flashlight. | ||
{{bug|Does not accept a configurable texture value from Hammer - will always default to the flashlight. You must use the <code>SpotlightTexture</code> [[input]] instead.}} | {{bug|Does not accept a configurable texture value from Hammer - will always default to the flashlight. You must use the <code>SpotlightTexture</code> [[input]] instead.}} | ||
=== Enabling multiple shadow maps === | === Enabling multiple shadow maps === | ||
Line 80: | Line 79: | ||
: See lightfov keyvalue above. | : See lightfov keyvalue above. | ||
* {{i parentname}} | |||
* {{i targetname}} | |||
=== Inputs not in FGD === | |||
These inputs are not known to Hammer, but are still accepted by the entity: | |||
*; target <entity> | *; target <entity> | ||
: Specify a new <target_desination> entity. | : Specify a new <target_desination> entity. | ||
Line 93: | Line 98: | ||
*; EnableShadows <bool> | *; EnableShadows <bool> | ||
: See above keyvalues. | : See above keyvalues. | ||
;Ambient <float> | *;Ambient <float> | ||
;SpotlightTexture <VTF/string> | *;SpotlightTexture <VTF/string> | ||
:A [[Valve Texture Format|VTF]] file (not VMT), relative to <code>/models</code>. | :A [[Valve Texture Format|VTF]] file (not VMT), relative to <code>/models</code>. | ||
==Outputs== | ==Outputs== | ||
* {{o targetname}} | * {{o targetname}} |
Revision as of 01:26, 14 April 2008
Template:Wrongtitle Template:Base point ep2
Entity Description
Creates a dynamic shadow-casting light that affects all objects in the world. Used for the Episode Two flashlight.
Enabling multiple shadow maps
Valve's games only allow one projected texture to cast shadows at a time - including the player's flashlight! To surmount this, shadow casting can be disabled on each entity with the enableshadows
KV, or for a proper solution a programmer can perform this C++ fix:
CClientShadowMgr::Init() - bool bTools = CommandLine()->CheckParm( "-tools" ) != NULL; - m_nMaxDepthTextureShadows = bTools ? 4 : 1; // Just one shadow depth texture in games, more in tools + m_nMaxDepthTextureShadows = YOUR_CHOSEN_MAX;
Garry's Mod has already had this done. Thanks to Garry for sharing the code!
Keyvalues
- target <target_destination>
- The entity will rotate to point at its target, no matter where it is in the world. See also
lightonlytarget
. Bug:Can get glitchy. [todo tested in ?]
- lightfov <float>
- The 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 <float>
- Near Z for projected texture. Default value is 4.0.
- Objects closer than this will not receive the projection.
- farz <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.
- enableshadows <boolean>
- Should I cast (dynamic) shadows?
- 0 = No, 1 = Yes.
- shadowquality <boolean>
- Quality of (dynamic) shadows?
- 0 = Low, 1 = High.
- lightonlytarget <boolean>
- Should I light only the entity that is my
target
? - 0 = No, 1 = Yes.
Bug:Non-functional. [todo tested in ?]
- lightworld <boolean>
- Should I light world brushes?
- cameraspace <boolean>
- Display relative to player's view. Breaks things horribly unless the entity moves with the player.
- lightcolor ⇆#000000rgb(0,0,0)⇆
- Projected color
Flags
- 1 : Enabled
Inputs
- TurnOn
- TurnOff
- FOV <float>
- See lightfov keyvalue above.
Inputs not in FGD
These inputs are not known to Hammer, but are still accepted by the entity:
- target <entity>
- Specify a new <target_desination> entity.
- cameraspace <bool>
- See above keyvalues.
- LightOnlyTarget <bool>
- See above keyvalues.
Bug:Non-functional. [todo tested in ?]
- LightWorld <bool>
- See above keyvalues.
Bug:Cannot be re-enabled. [todo tested in ?]
- EnableShadows <bool>
- See above keyvalues.
- Ambient <float>
- SpotlightTexture <VTF/string>
- A VTF file (not VMT), relative to
/models
.