Zh/$phong: Difference between revisions
< Zh
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 60: | Line 60: | ||
{{MatParam|$shinybloodexponent|int|Exponent for the above.|only={{L4ds}}|shaders=VertexLitGeneric, Infected}} | {{MatParam|$shinybloodexponent|int|Exponent for the above.|only={{L4ds}}|shaders=VertexLitGeneric, Infected}} | ||
=== | === 亮度 === | ||
{{MatParam|$phongboost|float|Phong brightness factor. Larger values create a more intense highlight, useful for surfaces like metal and glass.|shaders=VertexLitGeneric, LightmappedGeneric({{mapbase|only}})}} | {{MatParam|$phongboost|float|Phong brightness factor. Larger values create a more intense highlight, useful for surfaces like metal and glass.|shaders=VertexLitGeneric, LightmappedGeneric({{mapbase|only}})}} | ||
{{MatParam|$phongfresnelranges|matrix|See [[Phong materials#Phong Fresnel ranges|Phong Fresnel ranges]]. Default is <code>"[0 0.5 1]"</code>. | {{MatParam|$phongfresnelranges|matrix|See [[Phong materials#Phong Fresnel ranges|Phong Fresnel ranges]]. Default is <code>"[0 0.5 1]"</code>. | ||
Line 67: | Line 67: | ||
{{MatParam|$phongdisablehalflambert|bool|Disables forced [[$halflambert|half-lambertian]] shading on Phong materials. {{note|This parameter is effectively forced on in {{csgobranch|4}} due to <code>$halflambert</code> being disabled.}}|since={{as}}|also={{Mapbase}}|shaders=VertexLitGeneric}} | {{MatParam|$phongdisablehalflambert|bool|Disables forced [[$halflambert|half-lambertian]] shading on Phong materials. {{note|This parameter is effectively forced on in {{csgobranch|4}} due to <code>$halflambert</code> being disabled.}}|since={{as}}|also={{Mapbase}}|shaders=VertexLitGeneric}} | ||
=== | === 色彩 === | ||
{{MatParam|$phongalbedotint|bool|Tints the phong reflection by the color of the <code>$basetexture</code>. The amount of tint is defined by the green channel of <code>$phongexponenttexture</code>. A <code>$phongexponenttexture</code> must be specified in order for <code>$phongalbedotint</code> to work. | {{MatParam|$phongalbedotint|bool|Tints the phong reflection by the color of the <code>$basetexture</code>. The amount of tint is defined by the green channel of <code>$phongexponenttexture</code>. A <code>$phongexponenttexture</code> must be specified in order for <code>$phongalbedotint</code> to work. | ||
: {{Warning|<code>$phongalbedotint</code> cannot be used with <code>$phongtint</code>. The later will disable the effect.}} | : {{Warning|<code>$phongalbedotint</code> cannot be used with <code>$phongtint</code>. The later will disable the effect.}} | ||
Line 101: | Line 101: | ||
== 另见 == | == 另见 == | ||
* [[Phong materials]] | * [[Phong materials]] | ||
* {{ent|$envmap}} | * {{ent|$envmap}}(环境贴图) | ||
* {{ent|$lightwarptexture}} | * {{ent|$lightwarptexture}} | ||
* {{ent|$rimlight}} | * {{ent|$rimlight}} | ||
* [https://tf2maps.net/threads/phong-on-brushes-the-hacky-way.26765 $Phong on brushes*: The Hacky Way (a TF2maps.net guide on how to fake $Phong on brushes for games prior to CS:GO)] | * [https://tf2maps.net/threads/phong-on-brushes-the-hacky-way.26765 $Phong on brushes*: The Hacky Way (a TF2maps.net guide on how to fake $Phong on brushes for games prior to CS:GO)] | ||
*[https://share.substance3d.com/libraries/6595 SubstancePainter Source Engine Complex Phong Shader] | *[https://share.substance3d.com/libraries/6595 SubstancePainter Source Engine Complex Phong Shader] |
Revision as of 04:00, 25 April 2023
Template:Shaderparam It provides diffuse reflections at low intensity and specular highlights at apex intensity, masked by a texture which control per-texel its intensity. For a full explanation, see Phong materials.

LightmappedGeneric
and WorldVertexTransition
is only available in 

LightmappedGeneric
is also available in 
语法
$phong <bool>


- 待完善: 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]"
}
参数
蒙版

- Using $selfillumfresnel without $normalmapalphaenvmapmask will mask the $envmap using the $basetexture's alpha channel.
- Using $selfillumfresnel with $normalmapalphaenvmapmask will multiply the $envmap by
0.0f
. Effectively disabling the effect! - When not using $selfillumfresnel. The mask used for $envmap will be the $basetexture's alpha channel unless $normalmapalphaenvmapmask is also used.
- If $normalmapalphaenvmapmask is used, the $bumpmap's alpha channel will be used for Phong masking. Using either
$basemapalphaphongmask
or$basemapluminancephongmask
will override it.
$bumpmap
$basemapalphaphongmask
$basemapluminancephongmask
$phongexponent
$phongexponenttexture
$phongexponentfactor
$invertphongmask
$forcephong
$diffuseexp
$shinyblood
$shinybloodexponent
亮度
$phongboost
$phongfresnelranges
$phongdisablehalflambert
色彩
$phongalbedotint
$phongalbedoboost

Brush phong in
反恐精英:全球攻势 using tile/hr_t/inferno/tile_a. Note the complete absence of the reflection in the shaded area.

Brush Shader Parameters (仅存在于
之中)
$phongmaskcontrastbrightness
$phongamount
$phongbasetint
控制台命令
- mat_phong <布尔值 >
- 禁用或启用冯氏反射渲染。默认为 1。