$phong
Jump to navigation
Jump to search
The $phong
VMT command provides diffuse reflections. It is only available with VertexLitGeneric
. For a full explanation, see Phong materials.
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]"
}
Parameters
Masking
$bumpmap <texture>
- There must be a bump map. Its alpha channel acts as a Phong mask by default.
- Template:L4D add
- Phong intensity is based on the brightness of
$basetexture
. $BasemapAlphaPhongMask <bool>
- Reads the Phong mask from
$basetexture
's alpha channel instead of$bumpmap
's. $PhongExponent <int>
$PhongExponentTexture <texture>
- An global exponent value, or a per-texel exponent texture map. The numeric value wins if both are present. In an exponent map:
- Red channel: Exponent (size of highlight, higher is larger)
- Green channel: Albedo tint (if
$phongalbedotint 1
, higher is more tint) - Blue channel: Nothing
- Alpha channel:
$rimlight
mask
- Template:L4D add
- Template:L4D add
$allowdiffusemodulation <int>
- [Todo]
$DiffuseExp
- Todo: Does this have something to do with the $phongexponent, $phongexponenttexture or both?
Brightness
$phongboost <int>
- Phong brightness factor. The phong mask channel should be authored to account for this.
$PhongFresnelRanges <matrix>
- See Phong Fresnel ranges. Default is
"[0 0.5 1]"
. $PhongDisableHalfLambert <bool>
Template:P2 add- Used in Portal 2 on the Personality Cores such as Wheatley, disables functionality of $halflambert. MAY need
$halflambert 0
! $AmbientOcclusionTexture <texture>
- A "dirtmap". Mentioned in the SDK samples and seen in the VMT for Alyx's face. Ambient Occlusion is generally used for the eyes and face.
Colours
$PhongAlbedoTint <bool>
- Allows the
$basetexture
to affect the colour of the Phong highlight. The amount of tint is defined by the green channel of$phongexponenttexture
(see above). $phongtint "[<red float> <green float> <blue float>]"
- Modifies the colour of the phong reflection. The channels are interpreted relative to each other (so "[0 0 0]" and "[1 1 1]" are the same).
$PhongWarpTexture <texture>
Template:EP2 add- Todo: Used to create an iridescence effect, as seen on npc_hunters.
See also
- Phong materials
- $envmap (environment map)
- $lightwarptexture
- $rimlight