这篇条目有关 Source引擎。如需详情,点击这里。

Zh/$phong: Difference between revisions

From Valve Developer Community
< Zh
Jump to navigation Jump to search
(chatgpt translation)
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{LanguageBar}}
{{LanguageBar}}
{{this is a|shader parameter|name=$phong|since=Source 2006|shader=VertexLitGeneric}}  
{{this is a|shader parameter|name=$phong|since=Source 2006|shader=VertexLitGeneric}}  
Line 36: Line 35:
* '''如果'''使用了{{ent|$normalmapalphaenvmapmask}},则将使用{{ent|$bumpmap}}的alpha通道作为Phong遮罩,但使用<code>$basemapalphaphongmask</code>或<code>$basemapluminancephongmask</code>将会覆盖此行为。   
* '''如果'''使用了{{ent|$normalmapalphaenvmapmask}},则将使用{{ent|$bumpmap}}的alpha通道作为Phong遮罩,但使用<code>$basemapalphaphongmask</code>或<code>$basemapluminancephongmask</code>将会覆盖此行为。   
<br>   
<br>   
{{MatParam|$bumpmap|texture|Phong需要遮罩。[[$bumpmap|法线贴图]]的[[alpha通道]]默认作为Phong遮罩。}}   
{{MatParamDef|$bumpmap|texture|Phong需要遮罩。[[$bumpmap|法线贴图]]的[[alpha通道]]默认作为Phong遮罩。}}   
{{MatParam|$basemapalphaphongmask|bool|使用{{ent|$basetexture}}的[[alpha通道]]作为Phong遮罩,而不是<code>$bumpmap</code>的[[alpha通道]]。   
{{MatParamDef|$basemapalphaphongmask|bool|使用{{ent|$basetexture}}的[[alpha通道]]作为Phong遮罩,而不是<code>$bumpmap</code>的[[alpha通道]]。   
{{warning|与{{ent|$normalmapalphaenvmapmask}}一起使用时,将覆盖{{ent|$envmap}}所用的遮罩为{{ent|$basetexture}}的alpha通道内容!}}   
{{warning|与{{ent|$normalmapalphaenvmapmask}}一起使用时,将覆盖{{ent|$envmap}}所用的遮罩为{{ent|$basetexture}}的alpha通道内容!}}   
{{warning|{{gmod|4}} 如果同时使用{{ent|$normalmapalphaenvmapmask}}、{{ent|$envmap}}和{{ent|$basemapalphaphongmask}},则'''<code>$phong</code>'''和{{ent|$envmap}}将同时被'''<code>$basemapalphaphongmask</code>''' alpha通道和{{ent|$normalmapalphaenvmapmask}} alpha通道遮罩。}} |since={{src07}}|shaders=VertexLitGeneric}}   
{{warning|{{gmod|4}} 如果同时使用{{ent|$normalmapalphaenvmapmask}}、{{ent|$envmap}}和{{ent|$basemapalphaphongmask}},则'''<code>$phong</code>'''和{{ent|$envmap}}将同时被'''<code>$basemapalphaphongmask</code>''' alpha通道和{{ent|$normalmapalphaenvmapmask}} alpha通道遮罩。}} |since={{src07}}|shaders=VertexLitGeneric}}   
{{MatParam|$basemapluminancephongmask|bool|基于<code>$basetexture</code>的亮度遮罩Phong强度。   
{{MatParamDef|$basemapluminancephongmask|bool|基于<code>$basetexture</code>的亮度遮罩Phong强度。   
{{bug|当使用{{ent|$normalmapalphaenvmapmask}}时,Basetexture Luminance将替换{{ent|$envmap}}的遮罩。}}   
{{bug|当使用{{ent|$normalmapalphaenvmapmask}}时,Basetexture Luminance将替换{{ent|$envmap}}的遮罩。}}   
{{bug|在{{gmod|4}}中不起作用。}}   
{{bug|在{{gmod|4}}中不起作用。}}   
|not={{gmod}}|since={{l4d}}|shaders=VertexLitGeneric}}   
|not={{gmod}}|since={{l4d}}|shaders=VertexLitGeneric}}   
{{MatParam|$phongexponent|and=$phongexponent2|int|一个全局[[Phong materials#Phong mask and exponent texture|指数]]值。覆盖任何存在的指数遮罩。   
{{MatParamDef|$phongexponent|and=$phongexponent2|int|一个全局[[Phong materials#Phong mask and exponent texture|指数]]值。覆盖任何存在的指数遮罩。   
: <code>$phongexponent2</code>是用于{{csgobranch|4}}中的<code>WorldVertexTransition</code>第二材质的参数。}}   
: <code>$phongexponent2</code>是用于{{csgobranch|4}}中的<code>WorldVertexTransition</code>第二材质的参数。}}   
{{MatParam|$phongexponenttexture|texture|一个逐像素的指数贴图。在指数贴图中:   
{{MatParamDef|$phongexponenttexture|texture|一个逐像素的指数贴图。在指数贴图中:   
:* '''红色通道:''' 指数遮罩(高光大小,0-255,其中0表示大高光,255表示小高光。)   
:* '''红色通道:''' 指数遮罩(高光大小,0-255,其中0表示大高光,255表示小高光。)   
:* '''绿色通道:''' Albedo色调遮罩(仅当<code>$phongalbedotint 1</code>时,0-255,其中0为无色调,255为完全色调。)   
:* '''绿色通道:''' Albedo色调遮罩(仅当<code>$phongalbedotint 1</code>时,0-255,其中0为无色调,255为完全色调。)   
Line 52: Line 51:
:* '''Alpha通道:''' {{ent|$rimlight}}遮罩(仅当'''<code>$rimmask 1</code>'''时。)   
:* '''Alpha通道:''' {{ent|$rimlight}}遮罩(仅当'''<code>$rimmask 1</code>'''时。)   
:{{Note|<code>LightmappedGeneric</code>和<code>WorldVertexTransition</code>不支持<code>$phongexponenttexture</code>,您必须使用<code>$phongexponent</code>代替。}}|shaders=VertexLitGeneric}}   
:{{Note|<code>LightmappedGeneric</code>和<code>WorldVertexTransition</code>不支持<code>$phongexponenttexture</code>,您必须使用<code>$phongexponent</code>代替。}}|shaders=VertexLitGeneric}}   
{{MatParam|$phongexponentfactor|float|将<code>$phongexponenttexture</code>中的指数乘以该参数的值。{{tip|该参数的默认值为<code>"0.0"</code>。然而,更合理的默认值应为<code>"149.0"</code>。}}|only={{src13mp}}{{tf2}}|shaders=VertexLitGeneric}}   
{{MatParamDef|$phongexponentfactor|float|将<code>$phongexponenttexture</code>中的指数乘以该参数的值。{{tip|该参数的默认值为<code>"0.0"</code>。然而,更合理的默认值应为<code>"149.0"</code>。}}|only={{src13mp}}{{tf2}}|shaders=VertexLitGeneric}}   
{{MatParam|$invertphongmask|bool|反转Phong遮罩的值。   
{{MatParamDef|$invertphongmask|bool|反转Phong遮罩的值。   
{{bug|在{{as}}和{{src13}}的Shadercode中,使用此参数将反转用于{{ent|$envmap}}的遮罩,而不是用于<code>$phong</code>的遮罩!}}   
{{bug|在{{as}}和{{src13}}的Shadercode中,使用此参数将反转用于{{ent|$envmap}}的遮罩,而不是用于<code>$phong</code>的遮罩!}}   
{{confirm| 这种情况是否适用于所有分支?}}   
{{confirm| 这种情况是否适用于所有分支?}}   
|since={{src07}}|shaders=VertexLitGeneric}}   
|since={{src07}}|shaders=VertexLitGeneric}}   
{{MatParam|$forcephong|bool|即使在GPU等级较低并且<code>mat_phong</code>被禁用时,仍强制启用使用Phong的材质的Phong阴影效果。|since={{portal2}}|shaders=VertexLitGeneric}}   
{{MatParamDef|$forcephong|bool|即使在GPU等级较低并且<code>mat_phong</code>被禁用时,仍强制启用使用Phong的材质的Phong阴影效果。|since={{portal2}}|shaders=VertexLitGeneric}}   
{{MatParam|$diffuseexp|float|仅用于动态光的漫反射指数。   
{{MatParamDef|$diffuseexp|float|仅用于动态光的漫反射指数。   
{{note|与{{ent|$halflambert}}一起使用会大幅降低其效果。}}|only={{L4ds}}|shaders=VertexLitGeneric, Infected}}   
{{note|与{{ent|$halflambert}}一起使用会大幅降低其效果。}}|only={{L4ds}}|shaders=VertexLitGeneric, Infected}}   
{{MatParam|$shinyblood|int|根据区域的红色程度衍生Phong遮罩。仅在禁用变化时有效。|only={{L4ds}}|shaders=VertexLitGeneric, Infected}}   
{{MatParamDef|$shinyblood|int|根据区域的红色程度衍生Phong遮罩。仅在禁用变化时有效。|only={{L4ds}}|shaders=VertexLitGeneric, Infected}}   
{{MatParam|$shinybloodexponent|int|用于上述的指数值。|only={{L4ds}}|shaders=VertexLitGeneric, Infected}}   
{{MatParamDef|$shinybloodexponent|int|用于上述的指数值。|only={{L4ds}}|shaders=VertexLitGeneric, Infected}}   


===亮度===
===亮度===
{{MatParam|$phongboost|float|Phong亮度系数。较大的值会产生更强烈的高光,适用于金属和玻璃等表面。|shaders=VertexLitGeneric, LightmappedGeneric({{mapbase|only}})}}   
{{MatParamDef|$phongboost|float|Phong亮度系数。较大的值会产生更强烈的高光,适用于金属和玻璃等表面。|shaders=VertexLitGeneric, LightmappedGeneric({{mapbase|only}})}}   
{{MatParam|$phongfresnelranges|matrix|请参见[[Phong materials#Phong Fresnel ranges|Phong Fresnel范围]]。默认值为<code>"[0 0.5 1]"</code>。   
{{MatParamDef|$phongfresnelranges|matrix|请参见[[Phong materials#Phong Fresnel ranges|Phong Fresnel范围]]。默认值为<code>"[0 0.5 1]"</code>。   
:{{note|如果材质同时启用了<code>$envmap</code>和Phong,这些Fresnel范围也会影响<code>$envmap</code>。}}   
:{{note|如果材质同时启用了<code>$envmap</code>和Phong,这些Fresnel范围也会影响<code>$envmap</code>。}}   
:{{note|如果指定了<code>phongwarptexture</code>,它会驱动该纹理的x分量。}}|shaders=VertexLitGeneric, LightmappedGeneric({{mapbase|only}})}}   
:{{note|如果指定了<code>phongwarptexture</code>,它会驱动该纹理的x分量。}}|shaders=VertexLitGeneric, LightmappedGeneric({{mapbase|only}})}}   
{{MatParam|$phongdisablehalflambert|bool|禁用强制的[[$halflambert|半朗伯]]阴影效果。{{note|在{{csgobranch|4}}中,由于<code>$halflambert</code>被禁用,此参数实际上被强制启用。}}|since={{as}}|also={{gmod}},{{Mapbase}}|shaders=VertexLitGeneric}}   
{{MatParamDef|$phongdisablehalflambert|bool|禁用强制的[[$halflambert|半朗伯]]阴影效果。{{note|在{{csgobranch|4}}中,由于<code>$halflambert</code>被禁用,此参数实际上被强制启用。}}|since={{as}}|also={{gmod}},{{Mapbase}}|shaders=VertexLitGeneric}}   




=== 颜色 ===   
=== 颜色 ===   
{{MatParam|$phongalbedotint|bool|通过<code>$basetexture</code>的颜色对Phong反射进行染色。染色的程度由<code>$phongexponenttexture</code>的绿色通道决定。必须指定<code>$phongexponenttexture</code>才能使<code>$phongalbedotint</code>生效。   
{{MatParamDef|$phongalbedotint|bool|通过<code>$basetexture</code>的颜色对Phong反射进行染色。染色的程度由<code>$phongexponenttexture</code>的绿色通道决定。必须指定<code>$phongexponenttexture</code>才能使<code>$phongalbedotint</code>生效。   
: {{Warning|<code>$phongalbedotint</code>无法与<code>$phongtint</code>同时使用,后者会禁用该效果。}}   
: {{Warning|<code>$phongalbedotint</code>无法与<code>$phongtint</code>同时使用,后者会禁用该效果。}}   
: {{Note|<code>$phongalbedotint</code>通过将<code>$basetexture</code>的颜色乘以反射实现,而不会使原材质变暗。反射的亮度会因此减弱,因此需在Phong遮罩或使用<code>$phongboost</code>时加以补偿。}}   
: {{Note|<code>$phongalbedotint</code>通过将<code>$basetexture</code>的颜色乘以反射实现,而不会使原材质变暗。反射的亮度会因此减弱,因此需在Phong遮罩或使用<code>$phongboost</code>时加以补偿。}}   
: {{Note|即使材质被<code>$color2</code>或<code>rendercolor</code>调整颜色,<code>$phongalbedotint</code>仍会使用<code>$basetexture</code>的原始颜色来染色高光。}}|since={{src07}}|shaders=VertexLitGeneric}}   
: {{Note|即使材质被<code>$color2</code>或<code>rendercolor</code>调整颜色,<code>$phongalbedotint</code>仍会使用<code>$basetexture</code>的原始颜色来染色高光。}}|since={{src07}}|shaders=VertexLitGeneric}}   
[[File:Albedotint example.jpg|thumb|200px|一个展示AlbedoTint效果的模型示例。]]   
[[File:Albedotint example.jpg|thumb|200px|一个展示AlbedoTint效果的模型示例。]]   
{{MatParam|$phongalbedoboost|float|Phong Albedo亮度增强因子,范围为0-255。   
{{MatParamDef|$phongalbedoboost|float|Phong Albedo亮度增强因子,范围为0-255。   
: {{note|这会乘以<code>$phongalbedotint</code>应用到Phong上的染色。}}   
: {{note|这会乘以<code>$phongalbedotint</code>应用到Phong上的染色。}}   
: {{bug|当使用[[$detail]]时,此功能无效。}}|since={{csgo}}|also={{gmod}}|shaders=VertexLitGeneric}}   
: {{bug|当使用[[$detail]]时,此功能无效。}}|since={{csgo}}|also={{gmod}}|shaders=VertexLitGeneric}}   
[[File:Phongwarp example.png|thumb|200px|Hunter模型在使用<code>$phongwarptexture</code>前后的对比,展示其对Phong反射的影响。]]   
[[File:Phongwarp example.png|thumb|200px|Hunter模型在使用<code>$phongwarptexture</code>前后的对比,展示其对Phong反射的影响。]]   
{{MatParam|$phongtint|RGB矩阵|对Phong反射进行颜色染色。   
{{MatParamDef|$phongtint|RGB矩阵|对Phong反射进行颜色染色。   
: {{Warning|如果同时使用<code>$phongtint</code>和<code>$phongalbedotint</code>,前者会覆盖后者的效果。}}   
: {{Warning|如果同时使用<code>$phongtint</code>和<code>$phongalbedotint</code>,前者会覆盖后者的效果。}}   
: {{note|也会对{{ent|$rimlight}}进行染色。}}|since={{src07}}|shaders=VertexLitGeneric}}   
: {{note|也会对{{ent|$rimlight}}进行染色。}}|since={{src07}}|shaders=VertexLitGeneric}}   
[[File:Phongwarp_coordinate_guide.png|thumb|200px|<code>$phongwarptexture</code>的坐标分解:计算的坐标、纹理和结果。]]   
[[File:Phongwarp_coordinate_guide.png|thumb|200px|<code>$phongwarptexture</code>的坐标分解:计算的坐标、纹理和结果。]]   
{{MatParam|$phongwarptexture|texture|用于创建虹彩效果,例如在《第二章》的[[npc_hunter|Hunter]]中体现的效果。   
{{MatParamDef|$phongwarptexture|texture|用于创建虹彩效果,例如在《第二章》的[[npc_hunter|Hunter]]中体现的效果。   
: 高光会与纹理相乘。采样像素的坐标如下:   
: 高光会与纹理相乘。采样像素的坐标如下:   
:x: 1 - (距离高光中心的距离)   
:x: 1 - (距离高光中心的距离)   
Line 96: Line 95:
=== 刷子着色器参数 ===   
=== 刷子着色器参数 ===   
:{{csgobranch|only}}{{also|{{gmod}}}}   
:{{csgobranch|only}}{{also|{{gmod}}}}   
{{MatParam|$phongmaskcontrastbrightness|and=$phongmaskcontrastbrightness2|vector2|第一个值控制遮罩中光亮和暗区域之间的对比度,第二个值控制整体亮度。   
{{MatParamDef|$phongmaskcontrastbrightness|and=$phongmaskcontrastbrightness2|vector2|第一个值控制遮罩中光亮和暗区域之间的对比度,第二个值控制整体亮度。   
: <code>$phongmaskcontrastbrightness2</code> 是用于<code>WorldVertexTransition</code>的第二个材质。   
: <code>$phongmaskcontrastbrightness2</code> 是用于<code>WorldVertexTransition</code>的第二个材质。   
: {{todo|找出这两个值的范围。}}|shaders=LightmappedGeneric, WorldVertexTransition}}   
: {{todo|找出这两个值的范围。}}|shaders=LightmappedGeneric, WorldVertexTransition}}   
{{MatParam|$phongamount|and=$phongamount2|vector4|前3个值控制颜色染色,第四个值控制亮度。第四个值可以超过1,但影响的是整个纹理的亮度,而不是仅仅高光。   
{{MatParamDef|$phongamount|and=$phongamount2|vector4|前3个值控制颜色染色,第四个值控制亮度。第四个值可以超过1,但影响的是整个纹理的亮度,而不是仅仅高光。   
: <code>$phongamount2</code> 是用于<code>WorldVertexTransition</code>的第二个材质。|shaders=LightmappedGeneric, WorldVertexTransition}}   
: <code>$phongamount2</code> 是用于<code>WorldVertexTransition</code>的第二个材质。|shaders=LightmappedGeneric, WorldVertexTransition}}   
{{MatParam|$phongbasetint|and=$phongbasetint2|float|允许<code>$basetexture</code>和/或<code>$basetexture2</code>为Phong高光染色。|shaders=LightmappedGeneric, WorldVertexTransition}}   
{{MatParamDef|$phongbasetint|and=$phongbasetint2|float|允许<code>$basetexture</code>和/或<code>$basetexture2</code>为Phong高光染色。|shaders=LightmappedGeneric, WorldVertexTransition}}   


== 控制命令 ==
== 控制命令 ==
{{IO|mat_phong|param=bool|禁用或启用Phong阴影。默认值为1。}}   
{{varcom|start}}
{{varcom|mat_phong||bool|禁用或启用Phong阴影。默认值为1。}}   
{{varcom|end}}


== 另请参阅 ==   
== 另请参阅 ==   

Latest revision as of 11:50, 23 August 2025

English (en)Español (es)Русский (ru)中文 (zh)Translate (Translate)

$phong是一个用于着色器 VertexLitGeneric材质(en)着色器(en)参数,可在所有的 起源 起源 游戏,自从 起源2006 起源2006 以来中使用。

Phong shading enhances Alyx's skin, hairband, and lip highlights.

此参数同样适用于 LightmappedGenericWorldVertexTransition shaders,并在所有 反恐精英:全球攻势 反恐精英:全球攻势 及以后的游戏中可用(也存在于 Garry's ModXengineMapbase 之中)。它通过一个纹理控制每个 texel 的强度,提供了 Wikipedia icon diffuse reflection 的低强度反射以及 Wikipedia icon specular highlight 的峰值高光。详细说明请参见 Phong materials

Note.png注意:LightmappedGenericWorldVertexTransition 的 Phong 着色仅在 CS:GO 引擎分支地层起源 中可用。它要求材质由 env_cascade_light 实体的阳光照亮才能正常工作,并使用由其生成的动态阴影作为传统 phong 遮罩之上的额外遮罩。((存在于自 地层起源 以来) env_projectedtexture 也会影响启用 phong 的刷子)
Icon-Bug.png错误*:Garry's Mod Garry's Modenv_sun 读取刷子 Phong 的光照方向;在有多个太阳的地图中,刷子上的 Phong 反射可能不准确。
Note.png注意:LightmappedGeneric 的 Phong 着色在 Mapbase Mapbase 中同样可用,但其实现方式有所不同。


$phong <bool>
Note.png注意:以下参数必须全部在材质中指定,Phong阴影才能正常工作,除非在Insurgency Insurgency中。
待完善: 记录其他不需要所有Phong参数的游戏(可能包括Portal 2及其更高版本)。
VertexLitGeneric
{
	$phong 1

	$bumpmap				[texture]            // 表面的法线贴图
	$phongexponent			5                   // Phong指数值(任选其一)
	$phongexponenttexture	[texture]            // 控制Phong指数的纹理(任选其一)
	$phongboost				1.0                 // 高光强度的倍增系数
	$phongfresnelranges		"[0 0.5 1]"         // 控制反射强度的菲涅耳范围设置
}

遮罩

Warning.png警告:在使用$phong时,$normalmapalphaenvmapmask$selfillumfresnel存在一些注意事项!


Phong需要遮罩。法线贴图alpha通道默认作为Phong遮罩。
$basemapalphaphongmask(en) <布尔值(en)> (存在于自 起源2007 以来)
Shader(s): VertexLitGeneric
使用$basetexturealpha通道作为Phong遮罩,而不是$bumpmapalpha通道
Warning.png警告:$normalmapalphaenvmapmask一起使用时,将覆盖$envmap所用的遮罩为$basetexture的alpha通道内容!
Warning.png警告:Garry's Mod Garry's Mod 如果同时使用$normalmapalphaenvmapmask$envmap$basemapalphaphongmask,则$phong$envmap将同时被$basemapalphaphongmask alpha通道和$normalmapalphaenvmapmask alpha通道遮罩。
$basemapluminancephongmask(en) <布尔值(en)> (存在于自 求生之路 以来)
Shader(s): VertexLitGeneric
基于$basetexture的亮度遮罩Phong强度。
Icon-Bug.png错误:当使用$normalmapalphaenvmapmask时,Basetexture Luminance将替换$envmap的遮罩。  [todo tested in ?]
Icon-Bug.png错误:Garry's Mod Garry's Mod中不起作用。  [todo tested in ?]
一个全局指数值。覆盖任何存在的指数遮罩。
$phongexponent2是用于CS:GO 引擎分支 CS:GO 引擎分支中的WorldVertexTransition第二材质的参数。
Shader(s): VertexLitGeneric
一个逐像素的指数贴图。在指数贴图中:
  • 红色通道: 指数遮罩(高光大小,0-255,其中0表示大高光,255表示小高光。)
  • 绿色通道: Albedo色调遮罩(仅当$phongalbedotint 1时,0-255,其中0为无色调,255为完全色调。)
  • 蓝色通道: 无作用。
  • Alpha通道: $rimlight遮罩(仅当$rimmask 1时。)
Note.png注意:LightmappedGenericWorldVertexTransition不支持$phongexponenttexture,您必须使用$phongexponent代替。
$phongexponentfactor(en) <浮点型(en)> (存在于 起源2013 多人分支军团要塞2 之中)
Shader(s): VertexLitGeneric
$phongexponenttexture中的指数乘以该参数的值。
Tip.png提示:该参数的默认值为"0.0"。然而,更合理的默认值应为"149.0"
$invertphongmask(en) <布尔值(en)> (存在于自 起源2007 以来)
Shader(s): VertexLitGeneric
反转Phong遮罩的值。
Icon-Bug.png错误:异形丛生起源2013的Shadercode中,使用此参数将反转用于$envmap的遮罩,而不是用于$phong的遮罩!  [todo tested in ?]
证实: 这种情况是否适用于所有分支?
$forcephong(en) <布尔值(en)> (存在于自 传送门2 以来)
Shader(s): VertexLitGeneric
即使在GPU等级较低并且mat_phong被禁用时,仍强制启用使用Phong的材质的Phong阴影效果。
$diffuseexp(en) <浮点型(en)> (存在于 求生之路系列求生之路系列 之中)
Shader(s): VertexLitGeneric, Infected
仅用于动态光的漫反射指数。
Note.png注意:$halflambert一起使用会大幅降低其效果。
$shinyblood(en) <整数(en)> (存在于 求生之路系列求生之路系列 之中)
Shader(s): VertexLitGeneric, Infected
根据区域的红色程度衍生Phong遮罩。仅在禁用变化时有效。
$shinybloodexponent(en) <整数(en)> (存在于 求生之路系列求生之路系列 之中)
Shader(s): VertexLitGeneric, Infected
用于上述的指数值。

亮度

Shader(s): VertexLitGeneric, LightmappedGeneric((存在于 Mapbase 之中))
Phong亮度系数。较大的值会产生更强烈的高光,适用于金属和玻璃等表面。
Shader(s): VertexLitGeneric, LightmappedGeneric((存在于 Mapbase 之中))
请参见Phong Fresnel范围。默认值为"[0 0.5 1]"
Note.png注意:如果材质同时启用了$envmap和Phong,这些Fresnel范围也会影响$envmap
Note.png注意:如果指定了phongwarptexture,它会驱动该纹理的x分量。
$phongdisablehalflambert(en) <布尔值(en)> (存在于自 异形丛生 以来) (也存在于 Garry's Mod,Mapbase 之中)
Shader(s): VertexLitGeneric
禁用强制的半朗伯阴影效果。
Note.png注意:CS:GO 引擎分支 CS:GO 引擎分支中,由于$halflambert被禁用,此参数实际上被强制启用。


颜色

$phongalbedotint(en) <布尔值(en)> (存在于自 起源2007 以来)
Shader(s): VertexLitGeneric
通过$basetexture的颜色对Phong反射进行染色。染色的程度由$phongexponenttexture的绿色通道决定。必须指定$phongexponenttexture才能使$phongalbedotint生效。
Warning.png警告:$phongalbedotint无法与$phongtint同时使用,后者会禁用该效果。
Note.png注意:$phongalbedotint通过将$basetexture的颜色乘以反射实现,而不会使原材质变暗。反射的亮度会因此减弱,因此需在Phong遮罩或使用$phongboost时加以补偿。
Note.png注意:即使材质被$color2rendercolor调整颜色,$phongalbedotint仍会使用$basetexture的原始颜色来染色高光。
一个展示AlbedoTint效果的模型示例。
$phongalbedoboost(en) <浮点型(en)> (存在于自 反恐精英:全球攻势 以来) (也存在于 Garry's Mod 之中)
Shader(s): VertexLitGeneric
Phong Albedo亮度增强因子,范围为0-255。
Note.png注意:这会乘以$phongalbedotint应用到Phong上的染色。
Icon-Bug.png错误:当使用$detail时,此功能无效。  [todo tested in ?]
Hunter模型在使用$phongwarptexture前后的对比,展示其对Phong反射的影响。
$phongtint(en) <RGB矩阵(en)> (存在于自 起源2007 以来)
Shader(s): VertexLitGeneric
对Phong反射进行颜色染色。
Warning.png警告:如果同时使用$phongtint$phongalbedotint,前者会覆盖后者的效果。
Note.png注意:也会对$rimlight进行染色。
$phongwarptexture的坐标分解:计算的坐标、纹理和结果。
$phongwarptexture(en) <texture(en)> (存在于自 起源2007 以来)
Shader(s): VertexLitGeneric
用于创建虹彩效果,例如在《第二章》的Hunter中体现的效果。
高光会与纹理相乘。采样像素的坐标如下:
x: 1 - (距离高光中心的距离)
y: 1 - (由Phong Fresnel范围计算的Fresnel分量)
Note.png注意:禁用初始的phongfresnelranges遮罩
Icon-Bug.png错误:求生之路2 求生之路2中无效。  [todo tested in ?]
反恐精英:全球攻势 反恐精英:全球攻势中使用tile/hr_t/inferno/tile_a的刷子Phong效果。注意阴影区域完全缺乏反射。


刷子着色器参数

(存在于 CS:GO 引擎分支 之中)(也存在于 Garry's Mod 之中)
Shader(s): LightmappedGeneric, WorldVertexTransition
第一个值控制遮罩中光亮和暗区域之间的对比度,第二个值控制整体亮度。
$phongmaskcontrastbrightness2 是用于WorldVertexTransition的第二个材质。
待完善: 找出这两个值的范围。
Shader(s): LightmappedGeneric, WorldVertexTransition
前3个值控制颜色染色,第四个值控制亮度。第四个值可以超过1,但影响的是整个纹理的亮度,而不是仅仅高光。
$phongamount2 是用于WorldVertexTransition的第二个材质。
Shader(s): LightmappedGeneric, WorldVertexTransition
允许$basetexture和/或$basetexture2为Phong高光染色。

控制命令

控制台变量/命令 参数或默认值 描述符 效果
mat_phong bool 禁用或启用Phong阴影。默认值为1。

另请参阅

外部链接