$specmap texture: Difference between revisions
Jump to navigation
Jump to search

Bug: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. Example in this video.
Note:env_cascade_light doesn't work with this shader (at least on brush models and world geometry).
Confirm:Is the entity list is full?
MyGamepedia (talk | contribs) |
MyGamepedia (talk | contribs) No edit summary |
||
| Line 17: | Line 17: | ||
* {{ent|npc_plantlight}}, {{ent|npc_plantlight_stalker}} - light bulb from plant eye. | * {{ent|npc_plantlight}}, {{ent|npc_plantlight_stalker}} - light bulb from plant eye. | ||
* {{ent|player}} - first person flashlight (if enabled). Controlled using {{command|gb_flashlight_SpecMul}}, the default value is 0.8. | * {{ent|player}} - first person flashlight (if enabled). Controlled using {{command|gb_flashlight_SpecMul}}, the default value is 0.8. | ||
* {{ent|env_cascade_light}} - works only with {{ent|VertexLitGeneric}}. | |||
* {{ent|prop_barrel_cactus}} - lighting from this entity. | * {{ent|prop_barrel_cactus}} - lighting from this entity. | ||
* {{ent|prop_barrel_cactus_semilarge}} - lighting from this entity. | * {{ent|prop_barrel_cactus_semilarge}} - lighting from this entity. | ||
* {{ent|prop_barrel_interloper}} - lighting from this entity. | * {{ent|prop_barrel_interloper}} - lighting from this entity. | ||
* {{ent|prop_barrel_interloper_small}} - lighting from this entity. | * {{ent|prop_barrel_interloper_small}} - lighting from this entity. | ||
* {{ent|bmortar}} - lighting from this entity. | * {{ent|bmortar}} - lighting from this entity. | ||
Revision as of 09:12, 4 November 2025
$specmap_texture is a material shader parameter available in
Black Mesa.
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.
This shader is 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 new specular supports only new lights, while $phong also supports baked lights and has a lot of parameters, the only exception to this is prop_static.
List of entities this shader works with
- NewLight_Point, NewLight_Spot - controlled using
SpecularMultiplierkeyvalue. - npc_zombie_hev - flashlight used by this entity (if enabled).
- npc_plantlight, npc_plantlight_stalker - light bulb from plant eye.
- player - first person flashlight (if enabled). Controlled using
gb_flashlight_SpecMul, the default value is 0.8. - env_cascade_light - works only with VertexLitGeneric.
- prop_barrel_cactus - lighting from this entity.
- prop_barrel_cactus_semilarge - lighting from this entity.
- prop_barrel_interloper - lighting from this entity.
- prop_barrel_interloper_small - lighting from this entity.
- bmortar - lighting from this entity.
Parameters and Effects
Defines a specularmap texture for the shader.
|
|
Defines glossiness. Works differently depending on
$specmap_mode value.
|
|
|
|
|
|
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.Example VMT:
Todo: Check to see if parameters such as
$envmapmask or $basealphaenvmapmask and others affect new specular lights.See also
- $moss_enable - moss shader.
- $pomscale - parallax occlusion mapping shader.
- Lightmapped_4WayBlend - 4 way blend shader.
- $halflambert_gbuffer_off - gbuffer's halflambert option.
- newLight_Dir - directional sun light with godrays only.
- NewLights_Spawner - spawner of deferred point lights.
- env_lensflare - cinematic dynamic lens flare.
- newLight_Spot - spot deferred light entity.
- newLights_settings - entity that changes deferred light settings.
- godrays_settings - entity that changes godrays settings.
- env_cascade_light - deferred cascade sun light entity.
- New Lights Editor - in game deferred lights editor.
- Effect flags - effects flags, some of them are dynamic light effects.
- BlackMesa XenEngine: Part 4 – Lighting & Shadows - page from Chetan (lead programmer for Black Mesa) about new lights.
- BlackMesa XenEngine: Part2 – How a Frame is Rendered - page from Chetan (lead programmer for Black Mesa) about how a frame is rendered.
- BlackMesa XenEngine: Part1 – Heavily Modified Source Engine page from Chetan (lead programmer for Black Mesa) about
Xengine.