$phong

From Valve Developer Community
Revision as of 05:45, 12 July 2008 by TomEdwards (talk | contribs)
Jump to navigation Jump to search
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 parameters that you omit from your VMT. However it appears that in some cases this doesn't happen and the shader doesn't work. Therefore it is recommended that you include all the parameters and specify the default values yourself.

VertexLitGeneric
{
	$phong			1

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

Additional parameters

$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]".
$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.

See also