$specmap_texture

From Valve Developer Community
(Redirected from $specularcolor)
Jump to navigation Jump to search
English (en)Translate (Translate)

$specmap_texture is a material shader parameter available in Black Mesa Black Mesa.

New specular shader, example in bs_c3m0d. You can see how the floor reflects the red light source, same with the floodlight.

Shader used on surfaces to give them PBR style speculars. Works with VertexLitGeneric and LightmappedGeneric. This shader only works with deferred rendering lighting entities, which are using the SpecularMultiplier parameter. Those entities are: NewLight_Point, NewLight_Spot, npc_zombie_hev (flashlight), prop_barrel_cactus, prop_barrel_cactus_semilarge, prop_barrel_interloper, prop_barrel_interloper_small, env_cascade_light, bmortar, npc_plantlight, npc_plantlight_stalker, and player (flashlight).

Mainly used with LightmappedGeneric, because it is the only option for glossy effects on world geometry and brush models. VertexLitGeneric is mainly used with $phong instead, because $phong supports new lights, while this shader only supports baked lights and has a lot of parameters. The only exception to this is prop_static.

Confirm:Is this list full?
Warning.pngWarning:This shader is pretty expensive for the GPU. Not necessarily FPS drops, but it will heat up your GPU. Use wisely.
Note.pngNote:Doesn't work if $phong is enabled.
Icon-Bug.pngBug:If a material with $alphatest applied has a specular, and beneath it, there is another material with the same shader, will cause artifacts under a light source. This bug started occurring after Crowbar Collective fixed the outline artifacts for materials with $alphatest.
Note.pngNote:env_cascade_light doesn't work with this shader. (at least on brush models and world geometry)
Black Mesa Level Creation

Parameters and Effects

Defines a specularmap texture for the shader.
An example.


Controls the color and saturation of the specularity. If all three values are the same, the color obtained from deferred rendering light source will be used instead.
Examples.


Defines style and behaviour for speculars. Only 3 applicable values: 0, 1, and 2.
Examples.


Defines glossiness. Works differently depending on $specmap_mode value.
Examples of $specmap_mode - 0.


Examples of $specmap_mode - 1.


Examples of $specmap_mode - 2.


Use the alpha channel of the $bumpmap or $normalmap as a specular mask. $specmap_texture will be used as an additional mask or glossiness mask if $specmap_mode is set. This allows a blendable specular mask on LightmappedGeneric.
Todo: Check to see if parameters such as $envmapmask or $basealphaenvmapmask and others affect new specular lights.

Example VMT:

"VertexlitGeneric" { "$basetexture" "models/props_hc/t0a0/generic16" "$bumpmap" "models/props_hc/t0a0/generic16_normal" "$surfaceprop" "Metal" "$specmap_texture" "models/props_hc/t0a0/generic16_spec" "$specmap_mode" "2" "$speculargloss" "800" "$specularcolor" "[ 1 1 1 ]" }

See also