$phong: Difference between revisions
Jump to navigation
Jump to search
m (→Parameters) |
m (→Parameters) |
||
Line 28: | Line 28: | ||
; <code>$bumpmap <[[texture]]></code> | ; <code>$bumpmap <[[texture]]></code> | ||
: There must be a [[$bumpmap|bump map]]. Its [[alpha channel]] acts as a Phong mask by default. | : There must be a [[$bumpmap|bump map]]. Its [[alpha channel]] acts as a Phong mask by default. | ||
; <code>$ | ; <code>$BasemapLuminancePhongMask <[[bool]]></code> | ||
: {{todo|Brightness of albedo determines amount of phong?}} | : {{todo|Brightness of albedo determines amount of phong?}} | ||
;<code>$ | ;<code>$BasemapAlphaPhongMask <bool></code> | ||
: Reads the Phong mask from <code>[[$basetexture]]</code>'s [[alpha channel]] instead of <code>$bumpmap</code>'s. | : Reads the Phong mask from <code>[[$basetexture]]</code>'s [[alpha channel]] instead of <code>$bumpmap</code>'s. | ||
; <code>$ | ; <code>$PhongExponent <[[int]]></code> | ||
; <code>$ | ; <code>$PhongExponentTexture <texture></code> | ||
: An global [[Phong materials#Phong mask and exponent texture|exponent]] value, or a per-texel exponent texture map. The numeric value wins if both are present. In an exponent map: | : An global [[Phong materials#Phong mask and exponent texture|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) | :* '''Red channel:''' Exponent (size of highlight, higher is larger) | ||
Line 44: | Line 44: | ||
; <code>$phongboost <[[int]]></code> | ; <code>$phongboost <[[int]]></code> | ||
: Phong brightness factor. The phong mask channel should be authored to account for this. | : Phong brightness factor. The phong mask channel should be authored to account for this. | ||
; <code>$ | ; <code>$PhongFresnelRanges <matrix></code> | ||
: See [[Phong materials#Phong Fresnel ranges|Phong Fresnel ranges]]. Default is <code>"[0 0.5 1]"</code>. | : See [[Phong materials#Phong Fresnel ranges|Phong Fresnel ranges]]. Default is <code>"[0 0.5 1]"</code>. | ||
; <code>$ | ; <code>$PhongDisableHalfLambert <bool></code> | ||
: Used in [[Portal 2]] on the Personality Cores such as Wheatley, disables functionality of $halflambert. MAY need <code>$halflambert 0</code>! | : Used in [[Portal 2]] on the Personality Cores such as Wheatley, disables functionality of $halflambert. MAY need <code>$halflambert 0</code>! | ||
;<code>$ | ;<code>$AmbientOcclusionTexture <texture></code> | ||
: A "dirtmap". Mentioned in the SDK samples and seen in the VMT for Alyx's face. [[$ambientocclusion|Ambient Occlusion]] is generally used for the eyes and face. | : A "dirtmap". Mentioned in the SDK samples and seen in the VMT for Alyx's face. [[$ambientocclusion|Ambient Occlusion]] is generally used for the eyes and face. | ||
=== Colours === | === Colours === | ||
; <code>$ | ; <code>$PhongAlbedoTint <bool></code> | ||
: Allows the <code>[[$basetexture]]</code> to affect the colour of the Phong highlight. The amount of tint is defined by the green channel of <code>$phongexponenttexture</code> (see above). | : Allows the <code>[[$basetexture]]</code> to affect the colour of the Phong highlight. The amount of tint is defined by the green channel of <code>$phongexponenttexture</code> (see above). | ||
; <code>$phongtint "[<red [[float]]> <green float> <blue float>]" | ; <code>$phongtint "[<red [[float]]> <green float> <blue float>]" | ||
: Modifies the colour of the phong reflection. <code>"[0 0 0]"</code> means the feature is disabled. | : Modifies the colour of the phong reflection. <code>"[0 0 0]"</code> means the feature is disabled. | ||
; <code>$ | ; <code>$PhongWarpTexture <texture></code> {{EP2 add}} | ||
: {{todo|Used to create an iridescence effect, as seen on [[npc_hunter]]s.}} | : {{todo|Used to create an iridescence effect, as seen on [[npc_hunter]]s.}} | ||
Revision as of 03:12, 11 July 2011
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.
$BasemapLuminancePhongMask <bool>
- Todo: Brightness of albedo determines amount of phong?
$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
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>
- 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.
"[0 0 0]"
means the feature is disabled. $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