$phong: Difference between revisions
Jump to navigation
Jump to search
Note:Phong shading for
. 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.
Note:All parameters in the following example must be specified in the material, otherwise the phong shader won't show up at all, except in
.
Deprecated (talk | contribs) (Added more parameters, $forcephong, $phongbasetint, $phongbasetint2, $phongmaskcontrastbrightness2, $phongamount2, $phongexponent2, $phongdisablehalflambert doesn't need $halflambert 0, misc fixes) |
Deprecated (talk | contribs) (Combined some "2" parameters with their counterpart parameters, changed brush shader parameters to CSGO only as they aren't in any other games) |
||
Line 26: | Line 26: | ||
=== Masking === | === Masking === | ||
{{MatParam|$bumpmap|texture|There must be a Phong mask. The [[alpha channel]] of a | {{MatParam|$bumpmap|texture|There must be a Phong mask. The [[alpha channel]] of a [[$bumpmap|bump map]] acts as a Phong mask by default.}} | ||
{{MatParam|$basemapalphaphongmask|bool|Use {{ent|$basetexture}}'s [[alpha channel]] as the Phong mask instead of <code>$bumpmap</code>'s. The phong will not be influenced by the bumpmap, however.}} | {{MatParam|$basemapalphaphongmask|bool|Use {{ent|$basetexture}}'s [[alpha channel]] as the Phong mask instead of <code>$bumpmap</code>'s. The phong will not be influenced by the bumpmap, however.}} | ||
{{MatParam|$basemapluminancephongmask|bool|Mask phong intensity based on the brightness of the <code>$basetexture</code>.|since=L4D}} | {{MatParam|$basemapluminancephongmask|bool|Mask phong intensity based on the brightness of the <code>$basetexture</code>.|since=L4D}} | ||
{{MatParam|$phongexponent|int|The numeric value overrides an exponent mask if present.}} | {{MatParam|$phongexponent|and=$phongexponent2|int|The numeric value overrides an exponent mask if present. | ||
: <code>$phongexponent2</code> is for <code>WorldVertexTransition</code>'s second material in {{csgo}}.}} | |||
{{MatParam|$phongexponenttexture|texture|A global [[Phong materials#Phong mask and exponent texture|exponent]] value, or a per-texel exponent texture map. In an exponent map: | {{MatParam|$phongexponenttexture|texture|A global [[Phong materials#Phong mask and exponent texture|exponent]] value, or a per-texel exponent texture map. In an exponent map: | ||
:* '''Red channel:''' Exponent (size of highlight, 0-255, where a value of 0 is a large highlight, 255 small.) | :* '''Red channel:''' Exponent (size of highlight, 0-255, where a value of 0 is a large highlight, 255 small.) | ||
Line 64: | Line 65: | ||
=== Brush Shader Parameters === | === Brush Shader Parameters === | ||
{{MatParam|$phongmaskcontrastbrightness|vector2|<code>LightmappedGeneric</code> and <code>WorldVertexTransition</code> only. The first value controls the contrast level between light and dark areas in the mask, and the second value controls the overall brightness. | {{MatParam|$phongmaskcontrastbrightness|and=$phongmaskcontrastbrightness2|vector2|<code>LightmappedGeneric</code> and <code>WorldVertexTransition</code> only. The first value controls the contrast level between light and dark areas in the mask, and the second value controls the overall brightness. | ||
: {{todo|Find out the range of both values, and whether or not <code>VertexLitGeneric</code> can support this parameter.}}| | : <code>$phongmaskcontrastbrightness2</code> is for <code>WorldVertexTransition</code>'s second material. | ||
{{MatParam|$ | : {{todo|Find out the range of both values, and whether or not <code>VertexLitGeneric</code> can support this parameter.}}|only=CSGO}} | ||
{{MatParam|$phongamount|and=$phongamount2|vector4|<code>LightmappedGeneric</code> and <code>WorldVertexTransition</code> only. The first 3 values control the color tint, and the fourth value controls the brightness. The fourth value can go beyond 1, but affects the brightness of the whole texture, not just the highlight. | |||
: <code>$phongamount2</code> is for <code>WorldVertexTransition</code>'s second material.|only=CSGO}} | |||
{{MatParam|$phongbasetint|and=$phongbasetint2|float|{{todo|What are these?}}|only=CSGO}} | |||
{{MatParam|$phongbasetint|float|{{todo|What | |||
== See also == | == See also == |
Revision as of 13:57, 24 August 2019
Template:Shaderparam It provides diffuse reflections, masked by a texture to control its intensity per-texel. For a full explanation, see Phong materials.

LightmappedGeneric
and WorldVertexTransition
is only available in 
Syntax
$phong <bool>


- 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
$forcephong
$shinyblood
$shinybloodexponent
$diffuseexp
Brightness
$phongboost
$phongfresnelranges
$phongdisablehalflambert
$ambientocclusiontexture
Colours
$phongalbedotint
$phongalbedoboost
Brush Shader Parameters
$phongmaskcontrastbrightness
$phongamount
$phongbasetint
See also
- Phong materials
- $envmap (environment map)
- $lightwarptexture
- $rimlight