Env projectedtexture: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
Line 22: Line 22:


* {{kv targetname}}
* {{kv targetname}}
* '''target'''
;target
: <target_destination> Light target
: <target_destination> The entity will rotate to point at its target, no matter where it is in the world. See also <code>lightonlytarget</code>.
* '''lightfov'''
:{{bug|Can get glitchy.}}
: <float> Light's FOV
;lightfov <float>
* '''enableshadows'''
: The angle at which the texture is projected. The projection is square, but the texture can make it appear of any shape.
: {{boolean}} Cast shadows
;enableshadows {{boolean}}
* '''lightonlytarget'''
: Should I cast shadows?
: {{boolean}} Light only target
;lightonlytarget {{boolean}}
* '''lightworld'''
: Should I light only the entity that is my <code>target</code>?
: {{boolean}} Light world
:{{bug|Non-functional.}}
* '''cameraspace'''
;lightworld {{boolean}}
: {{boolean}} Relative to player's view
: Should I light world [[brush]]es?
* '''lightcolor'''
;cameraspace {{boolean}}
: {{color}} Projected color
: Display relative to player's view. Breaks things horribly unless the entity moves with the player.
;lightcolor {{color}}
: Projected color
:{{bug|Non-functional.}}


==Flags==
==Flags==

Revision as of 10:47, 6 April 2008

Template:Wrongtitle

Casting shadows.

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

Projecting a texture.
target
<target_destination> The entity will rotate to point at its target, no matter where it is in the world. See also lightonlytarget.
Icon-Bug.pngBug: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.
enableshadows <boolean>
Should I cast shadows?
lightonlytarget <boolean>
Should I light only the entity that is my target?
Icon-Bug.pngBug: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 #000000
Projected color
Icon-Bug.pngBug:Non-functional.  [todo tested in ?]

Flags

  • 1 : Enabled

Inputs

Outputs