$specmap texture: Difference between revisions
MyGamepedia (talk | contribs) No edit summary |
MyGamepedia (talk | contribs) (Added ent tmp, fixed my old english) |
||
Line 2: | Line 2: | ||
{{cleanup|grammar}} {{This is a|shader parameter|name=$specmap_texture|game=Black Mesa}} | {{cleanup|grammar}} {{This is a|shader parameter|name=$specmap_texture|game=Black Mesa}} | ||
[[File:NewSpecular=.jpg|thumb|right|New specular shader, example in <code>bs_c3m0d</code>. You can see how the floor reflects the red light source, the same for the floodlight.]] | [[File:NewSpecular=.jpg|thumb|right|New specular shader, example in <code>bs_c3m0d</code>. You can see how the floor reflects the red light source, the same for the floodlight.]] | ||
This shader is used for surfaces to give PBR style shiny speculars. Works with | This shader is used for surfaces to give PBR style shiny speculars. Works with {{ent|VertexLitGeneric}} and {{ent|LightmappedGeneric}}. This shader works ''only'' with deferred rendering lighting entities which are using <code>SpecularMultiplier</code> parameter (in the game code or as the property), the entities are: {{ent|NewLight_Point}}, {{ent|NewLight_Spot}}, {{ent|npc_zombie_hev}} (flashlight), {{ent|prop_barrel_cactus}}, {{ent|prop_barrel_cactus_semilarge}}, {{ent|prop_barrel_interloper}}, {{ent|prop_barrel_interloper_small}}, {{ent|env_cascade_light}}, {{ent|bmortar}}, {{ent|npc_plantlight}}, {{ent|npc_plantlight_stalker}}, {{ent|player}} (flashlight). | ||
{{ | |||
{{ | |||
{{ | This shader is mainly used for {{ent|LightmappedGeneric}}, because this is the only option to have gloss effect on world geometry and [[bmodel]]. For {{ent|VertexLitGeneric}} mainly used {{ent|$phong}}, because new lights are also support this shader; this shader works with baked lights and have a lot of parameters. | ||
{{ModernConfirm|Is the this is full ?}} | |||
{{warning|This shader is pretty expensive for GPU. May not cause FPS drops, but it will heat up your GPU very much. Use wisely.}} | |||
{{note|Doesn't work with [[$phong]] is enabled.}} | |||
{{bug|hidetested=1|If [[$alphatest|alpha tested]] material has a specular, and beneath it, there is also a material with the same shader, and in combination with new lights or a flashlight, this all will cause artifacts appear. This occurred after Crowbar Collective fixed the outline artifacts for alpha tested materials. [https://youtu.be/cb6Fw4rVXXo Example] (use full screen mode to watch).}} | {{bug|hidetested=1|If [[$alphatest|alpha tested]] material has a specular, and beneath it, there is also a material with the same shader, and in combination with new lights or a flashlight, this all will cause artifacts appear. This occurred after Crowbar Collective fixed the outline artifacts for alpha tested materials. [https://youtu.be/cb6Fw4rVXXo Example] (use full screen mode to watch).}} | ||
Line 17: | Line 19: | ||
{{expand|title=An example.| | {{expand|title=An example.| | ||
<br> | <br> | ||
<gallery mode=packed heights= | <gallery mode=packed heights=410px> | ||
File:Bs_fy_basement_floor01_spec=.jpg|An example of [[specularmap]] from {{bmsbs|4}}. | File:Bs_fy_basement_floor01_spec=.jpg|An example of [[specularmap]] from {{bmsbs|4}}. | ||
</gallery> | </gallery> | ||
Line 32: | Line 34: | ||
}} | }} | ||
}} | }} | ||
{{MatParam|$specmap_mode|int|Defines style and behaviour for speculars, there are 3 available values - 0, 1 and 2. | {{MatParam|$specmap_mode|int|Defines style and behaviour for speculars, there are 3 available values - 0, 1, and 2. | ||
{{expand|title=Examples.| | {{expand|title=Examples.| | ||
<br> | <br> |
Revision as of 13:15, 30 January 2025



$specmap_texture
is a material shader parameter available in Black Mesa.
This shader is used for surfaces to give PBR style shiny speculars. Works with VertexLitGeneric and LightmappedGeneric. This shader works only with deferred rendering lighting entities which are using SpecularMultiplier
parameter (in the game code or as the property), the 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, player (flashlight).
This shader is mainly used for LightmappedGeneric, because this is the only option to have gloss effect on world geometry and bmodel. For VertexLitGeneric mainly used $phong, because new lights are also support this shader; this shader works with baked lights and have a lot of parameters.





Parameters and Effects
$specmap_texture
$specularcolor
$specmap_mode
$speculargloss
$normalmapalphaenvmapmask
See also
- $phong (for diffuse reflection)
- newLight_Point
- newLight_Spot
- NewLights_settings
- env_cascade_light
- light_environment
- Advanced Lighting
- Effect flags (dynamic light effects)
- BlackMesa XenEngine: Part 4 – Lighting & Shadows (page from Black Mesa developer about new lights)
- BlackMesa XenEngine: Part2 – How a Frame is Rendered (page from Black Mesa developer about how a frame rendered, include Godrays.)
- BlackMesa XenEngine: Part1 – Heavily Modified Source Engine (page from Black Mesa developer about Black Mesa engine, better known as XenEngine)