$phong

From Valve Developer Community
Revision as of 10:52, 17 July 2019 by Deprecated (talk | contribs) (Rewritten, changed to use Shaderparam and MatParam templates)
Jump to navigation Jump to search
Phong shading provides Alyx's skin, hairband and lip highlights.

Template:Shaderparam It provides diffuse reflections, masked by a texture to control its intensity per-texel. For a full explanation, see Phong materials.

Note.pngNote:Phong shading for LightmappedGeneric and WorldVertexTransition is only available in Counter-Strike: Global Offensive. It requires the material to be lit by a env_cascade_light entity to work properly, and uses the dynamic shadows generated by it as a mask on top of the traditional phong masking.

VMT syntax

$phong <bool>
Note.pngNote:All parameters must be specified otherwise the phong shader won't show up at all, except in Insurgency.
Todo: Other games that don't require all phong parameters present (likely Portal 2 and up)
VertexLitGeneric
{
	$phong 1

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

Parameters

Masking

$bumpmap $basemapalphaphongmask $basemapluminancephongmask $phongexponent $phongexponenttexture $invertphongmask $phongexponentfactor $shinyblood $shinybloodexponent $diffuseexp

Brightness

$phongboost $phongfresnelranges $phongDisableHalfLambert $ambientocclusiontexture

Colours

$phongalbedotint $phongalbedoboost

The Hunter with and without its $phongwarptexture, showing how it

$phongtint $phongwarptexture

Brush Shader Parameters

$phongmaskcontrastbrightness $phongamount

See also