$phong: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (Robot: fixing template case.)
Line 35: Line 35:
; <code>$phongwarptexture <texture></code>
; <code>$phongwarptexture <texture></code>
: Used to create an iridescence effect on [[npc_hunter]]s.
: Used to create an iridescence effect on [[npc_hunter]]s.
: {{todo|Needs documentation.}}
: {{TODO|Needs documentation.}}
; <code>$lightwarptexture <texture></code>
; <code>$lightwarptexture <texture></code>
: A 1-dimensional ramp texture for defining the sharpness of shadows. Used to create TF2's quasi-illustrated character lighting.
: A 1-dimensional ramp texture for defining the sharpness of shadows. Used to create TF2's quasi-illustrated character lighting.
: {{todo|Needs documentation.}}
: {{TODO|Needs documentation.}}
; <code>$phongalbedotint <?></code>
; <code>$phongalbedotint <?></code>
: Allow the [[albedo]] (i.e. [[$basetexture]]) to affect the colour tint of the Phong highlight? Possibly related to the green channel of the Phong exponent mask. Seen in some Day of Defeat: Source player model VMTs.
: Allow the [[albedo]] (i.e. [[$basetexture]]) to affect the colour tint of the Phong highlight? Possibly related to the green channel of the Phong exponent mask. Seen in some Day of Defeat: Source player model VMTs.
: {{todo|Needs documentation.}}
: {{TODO|Needs documentation.}}
;<code>$ambientocclusiontexture <texture></code>
;<code>$ambientocclusiontexture <texture></code>
: A "dirtmap". Mentioned in the SDK samples and seen in the VMT for Alyx's face.
: A "dirtmap". Mentioned in the SDK samples and seen in the VMT for Alyx's face.
: {{todo|Needs documentation.}}
: {{TODO|Needs documentation.}}
;<code>$basemapalphaphongmask <1/0></code>
;<code>$basemapalphaphongmask <1/0></code>
: Enabled this if the phong texture is in the basetexture's alpha mask.
: Enabled this if the phong texture is in the basetexture's alpha mask.
;<code>"GPU>=2?$phong" 1</code>  
;<code>"GPU>=2?$phong" 1</code>  
: (Use with <code>$phong 0</code>) Only uses phong if the current PC is using dual GPUs.
: (Use with <code>$phong 0</code>) Only uses phong if the current PC is using dual GPUs.
: {{todo|Check if correct, it may be wrong}}
: {{TODO|Check if correct, it may be wrong}}


== See also ==
== See also ==

Revision as of 20:16, 19 January 2009

Phong shading provides Alyx's skin, hairband and lip highlights.

The $phong VMT command provides diffuse reflections. For a full explanation, see Phong materials.

Note.pngNote:Phong shading is only available with VertexLitGeneric.

VMT syntax

$phong <bool>

The Phong shader should use the default values for any configuration parameters that you omit from your material. However it appears that this doesn't happen. Therefore all of the below parameters are required, even if they stay on their default values.

VertexLitGeneric
{
	$phong			1

	$bumpmap		<texture>
	$phongexponent		5		// either/or
	$phongexponenttexture	<texture>	// either/or
	$phongboost		1.0
	$phongfresnelranges	"[0 0.5 1]"
}

Additional parameters

$bumpmap <texture>
The alpha channel of the material's bump map acts as a Phong mask. See $bumpmap.
$phongexponent <int>
$phongexponenttexture <texture>
See Phong mask and exponent texture. The texture value is overridden by the numeric value (if the latter is present).
$phongboost <int>
Phong overbrightening factor. The phong mask channel should be authored to account for this.
$phongfresnelranges <matrix>
See Phong Fresnel ranges. Default is "[0 0.5 1]".
$phongwarptexture <texture>
Used to create an iridescence effect on npc_hunters.
Todo: Needs documentation.
$lightwarptexture <texture>
A 1-dimensional ramp texture for defining the sharpness of shadows. Used to create TF2's quasi-illustrated character lighting.
Todo: Needs documentation.
$phongalbedotint <?>
Allow the albedo (i.e. $basetexture) to affect the colour tint of the Phong highlight? Possibly related to the green channel of the Phong exponent mask. Seen in some Day of Defeat: Source player model VMTs.
Todo: Needs documentation.
$ambientocclusiontexture <texture>
A "dirtmap". Mentioned in the SDK samples and seen in the VMT for Alyx's face.
Todo: Needs documentation.
$basemapalphaphongmask <1/0>
Enabled this if the phong texture is in the basetexture's alpha mask.
"GPU>=2?$phong" 1
(Use with $phong 0) Only uses phong if the current PC is using dual GPUs.
Todo: Check if correct, it may be wrong

See also