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

$bumpmap

From Valve Developer Community
< Zh
Jump to navigation Jump to search
Info content.png
This page needs to be translated.
This page either contains information that is only partially or incorrectly translated, or there isn't a translation yet.
If this page cannot be translated for some reason, or is left untranslated for an extended period of time after this notice is posted, the page should be requested to be deleted.
Also, please make sure the article tries to comply with the alternate languages guide.
English (en)Español (es)Français (fr)中文 (zh)Translate (Translate)

$bumpmap是一个材质(en)着色器(en)参数,可在所有的 起源 起源 游戏中使用。

材质的漫反射贴图(en)(左)与其法线贴图对比。
上述材质的游戏内效果。

该参数指定为材质提供三维光照信息的纹理(en)。该纹理属于凹凸贴图(en),但其应用过程被称为Wikipedia icon 法线贴图。不过这两个术语常被混用。

Warning.png警告:$bumpmap 会在所有CS:GO 引擎分支 CS:GO 引擎分支之前的Source游戏中禁用prop_static的逐顶点光照。
由于顶点中未存储足够的法线贴图数据,引擎只能回退处理。
Icon-Important.png重要:使用凹凸贴图的笔刷和置换表面会为每个面生成四张光照贴图(每个光照方向一张,外加非凹凸版本),而非一张。若在VMT中添加$bumpmap$normalmap但编译时未包含该参数,则地图必须重新编译。
Note.png注意:此规则不适用于使用-bumpall VBSP(en)参数编译的地图(该参数会为所有面生成4张光照贴图,无论是否启用凹凸贴图)。但应谨慎使用此参数,因其会显著增加光照贴图占用。
Icon-Important.png重要:$bumpmap 不适用于光照反射(en)。请改用$normalmap
Note.png注意:
Icon-Bug.png错误: $bumpmap 会导致部分参数失效。受影响参数包括(但不限于):   [todo tested in ?]

基础语法

LightmappedGeneric
{
	$basetexture	brick/brickwall021a
	$surfaceprop	brick
	$bumpmap		brick/brickwall021a_normal
}

附加参数

$bumptransform(en) <matrix(en)> (DX9 SM2)
对凹凸贴图纹理进行矩阵变换。
待完善: 是否必须DX9?在DX8回退着色器中存在。
Icon-Bug.png错误:$detail共用时失效。在CS:GO 引擎分支中有效。  [todo tested in ?]
The default position is center .5 .5 scale 1 1 rotate 0 translate 0 0.
  1. center defines the point of rotation. Only useful if rotate is being used.
  2. scale fits the texture into the material the given number of times. 2 1 is a 50% scale in the horizontal X axis while the vertical Y axis is still at original scale.
  3. rotate rotates the texture counter-clockwise in degrees. Accepts any number, including negatives.
  4. translate shifts the texture by the given numbers. .5 will shift it half-way. 1 will shift it once completely over, which is the same as not moving it at all.
Note.png注意:All values must be included!
Icon-Bug.png错误:Scaling the texture may cause odd issues where the Texture Lock tool in Hammer will not actually lock the texture in place.  [todo tested in ?]
Icon-Bug.png错误:Rotating textures applied on brushes will rotate around the map origin (confirm: Orangebox engine only?). A fix for this is to change the center position in the VMT to the brush's origin.  [todo tested in ?]
设置动画凹凸贴图的起始帧。
Shader(s): LightmappedGeneric, Lightmapped_4WayBlend, WorldVertexTransition
禁用凹凸贴图对材质反照率(en)光照的影响,有助于缓解过度绘制(en)。不影响高光贴图(en),适用于平面表面的扭曲反射效果。
Icon-Bug.png错误:起源2007 起源2007之后版本失效.[证实]  [todo tested in ?]
Note.png注意:起源2013 Source 2013 中可与$ssbump(en)共用,但常规法线贴图无效。需更多测试?
$ssbump(en) <布尔值(en)> (存在于自 起源2007 以来)
Shader(s): LightmappedGeneric, Lightmapped_4WayBlend, WorldVertexTransition
将凹凸贴图标记为自阴影贴图。点击查看详情。
$forcebump(en) <布尔值(en)> (DX8) (被移除求生之路 以来)
0:根据显卡支持情况启用凹凸贴图;1:始终强制启用。
$bump_force_on(en) <布尔值(en)> (存在于自 传送门2 以来)
Shader(s): LightmappedGeneric, Lightmapped_4WayBlend, WorldVertexTransition
强制启用凹凸贴图,即使低端设备也生效。
$addbumpmaps(en) <布尔值(en)> (存在于 CS:GO 引擎分支 之中)
Shader(s): LightmappedGeneric
LightmappedGeneric中启用双凹凸贴图混合。
$bumpmap2(en) <texture(en)> (DX9 SM2)
Shader(s): LightmappedGeneric, Lightmapped_4WayBlend, WorldVertexTransition
第二张凹凸贴图,用于WorldVertexTransitionCS:GO 引擎分支LightmappedGeneric的凹凸贴图混合。
$bumpframe2(en) <整数(en)> (DX9 SM2)
Shader(s): LightmappedGeneric, Lightmapped_4WayBlend, WorldVertexTransition
$bumpframe,但作用于第二张凹凸贴图。
$bumptransform2(en) <matrix(en)> (DX9 SM2)
Shader(s): LightmappedGeneric, Lightmapped_4WayBlend, WorldVertexTransition
$bumptransform,但作用于第二张凹凸贴图。
Note.png注意:LightmappedGeneric着色器使用$addbumpmaps,则$detail配合$detailscale会覆盖此参数。
$bumpmask(en) <texture(en)> (DX9 SM2)
Shader(s): LightmappedGeneric
使用两张凹凸贴图时,可用第三张凹凸贴图作为基底,其alpha通道作为前两张的遮罩。$bumpmask的alpha通道也用作高光遮罩。
Note.png注意:仅被半衰期2materials/nature/toxicslime002a使用。
Note.png注意:$detail$seamless_scale不兼容。
$bumpdetailscale1(en) and $bumpdetailscale2(en) <normal(en)> (存在于 CS:GO 引擎分支 之中)
Shader(s): LightmappedGeneric
设置第一、第二张凹凸贴图在混合时的强度。

控制台命令

mat_fastnobump <布尔值(en)>
快速切换法线贴图启用状态。
mat_normalmaps <布尔值(en)>
将所有材质的凹凸贴图显示在漫反射(en)贴图位置。
mat_bumpmap <布尔值(en)>
启用/禁用法线贴图。默认1。

另见