Env projectedtexture: Difference between revisions
Jump to navigation
Jump to search
TomEdwards (talk | contribs) (cleanup + how to enable multiple shadow maps) |
TomEdwards (talk | contribs) |
||
Line 7: | Line 7: | ||
== Enabling multiple shadow maps == | == 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 with the <code>enableshadows</code> KV, or for a proper solution a programmer can perform this fix: | 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 <code>enableshadows</code> KV, or for a proper solution a programmer can perform this C++ fix: | ||
''CClientShadowMgr::Init()'' | ''CClientShadowMgr::Init()'' |
Revision as of 10:36, 6 April 2008
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
- Template:Kv targetname
- target
- <target_destination> Light target
- lightfov
- <float> Light's FOV
- enableshadows
- <boolean> Cast shadows
- lightonlytarget
- <boolean> Light only target
- lightworld
- <boolean> Light world
- cameraspace
- <boolean> Relative to player's view
- lightcolor
- ⇆#000000rgb(0,0,0)⇆ Projected color
Flags
- 1 : Enabled
Inputs
- Template:I targetname
- TurnOn
- TurnOff
- SetFOV <float>