$specmap texture: Difference between revisions
No edit summary |
MyGamepedia (talk | contribs) (Replaced the pictures with compressed versions.) |
||
Line 1: | Line 1: | ||
{{langsp}} | {{langsp}} | ||
[[File:NewSpecular. | [[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 [[VertexLitGeneric]] and [[LightmappedGeneric]]. This shader work ''only'' with deferred rendering lighting entities which support and use <code>SpecularMultiplier</code> parametr (in the game code or as kayvalue), the entities is: [[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 used for surfaces to give PBR style shiny speculars. Works with [[VertexLitGeneric]] and [[LightmappedGeneric]]. This shader work ''only'' with deferred rendering lighting entities which support and use <code>SpecularMultiplier</code> parametr (in the game code or as kayvalue), the entities is: [[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). | ||
{{ModernConfirm|Is this full list of entities ?}} | {{ModernConfirm|Is this full list of entities ?}} | ||
Line 12: | Line 12: | ||
<br> | <br> | ||
<gallery mode=packed heights=710px> | <gallery mode=packed heights=710px> | ||
File: | File:Bs_fy_basement_floor01_spec=.jpg|An example of [[specularmap]] from {{bmsbs|4}}. | ||
</gallery> | </gallery> | ||
}} | }} | ||
Line 20: | Line 20: | ||
<br> | <br> | ||
<gallery mode=packed heights=410px> | <gallery mode=packed heights=410px> | ||
File:1 1 1. | File:1 1 1=.jpg|$specularcolor - 1 1 1. | ||
File:1 0 0. | File:1 0 0=.jpg|$specularcolor - 1 0 0. | ||
File:1 0 1. | File:1 0 1=.jpg|$specularcolor - 1 0 1. | ||
</gallery> | </gallery> | ||
}} | }} | ||
Line 30: | Line 30: | ||
<br> | <br> | ||
<gallery mode=packed heights=410px> | <gallery mode=packed heights=410px> | ||
File:mode 0. | File:mode 0=.jpg|$specmap_mode - 0. Seems to ignore $specmap_texture. | ||
File:mode 1. | File:mode 1=.jpg|$specmap_mode - 1. Seems to use $specmap_texture as glossiness map. | ||
File:mode 2. | File:mode 2=.jpg|$specmap_mode - 2. Seems to use $specmap_texture as tint map. | ||
</gallery> | </gallery> | ||
}} | }} | ||
}} | }} | ||
{{MatParam|$speculargloss|float|Defines gloss scale. Works differently depending on <code>$specmap_mode</code> value. | {{MatParam|$speculargloss|float|Defines gloss scale. Works differently depending on <code>$specmap_mode</code> value. | ||
{{expand|title=Examples.| | {{expand|title=Examples of $specmap_mode - 0.| | ||
<br> | |||
<gallery mode=packed heights=610px> | |||
File:mode 0 10=.jpg|$specmap_mode - 0. $speculargloss - 10 | |||
File:mode 0 100=.jpg|$specmap_mode - 0. $speculargloss - 100 | |||
File:mode 0 500=.jpg|$specmap_mode - 0. $speculargloss - 500 | |||
</gallery> | |||
}} | |||
{{expand|title=Examples of $specmap_mode - 1.| | |||
<br> | |||
<gallery mode=packed heights=610px> | |||
File:mode 1 10=.jpg|$specmap_mode - 1. $speculargloss - 10 | |||
File:mode 1 100=.jpg|$specmap_mode - 1. $speculargloss - 100 | |||
File:mode 1 500=.jpg|$specmap_mode - 1. $speculargloss - 500 | |||
</gallery> | |||
}} | |||
{{expand|title=Examples of $specmap_mode - 2.| | |||
<br> | <br> | ||
<gallery mode=packed heights=610px> | <gallery mode=packed heights=610px> | ||
File:mode 2 10=.jpg|$specmap_mode - 2. $speculargloss - 10 | |||
File:Mode_2=.jpg|$specmap_mode - 2. $speculargloss - 100 | |||
File:mode 2 500=.jpg|$specmap_mode - 2. $speculargloss - 500 | |||
File:mode 2 10. | |||
File:Mode_2. | |||
File:mode 2 500. | |||
</gallery> | </gallery> | ||
}} | }} | ||
Line 59: | Line 67: | ||
Unlike models - speculars doesn't work with [[env_cascade_light]] for world geometry. | Unlike models - speculars doesn't work with [[env_cascade_light]] for world geometry. | ||
<gallery mode=nolines heights=256px widths=384px> | <gallery mode=nolines heights=256px widths=384px> | ||
File: WGDWECL. | File: WGDWECL=.jpg|{{nbsp}} | ||
</gallery> | </gallery> | ||
Line 74: | Line 82: | ||
</nowiki>}} | </nowiki>}} | ||
<gallery mode=nolines heights=256px widths=384px> | <gallery mode=nolines heights=256px widths=384px> | ||
File: HAHAHAHAHAHAHAHAAH. | File: HAHAHAHAHAHAHAHAAH=.jpg|{{nbsp}} | ||
</gallery> | </gallery> | ||
Revision as of 03:10, 23 June 2024


This shader is used for surfaces to give PBR style shiny speculars. Works with VertexLitGeneric and LightmappedGeneric. This shader work only with deferred rendering lighting entities which support and use SpecularMultiplier
parametr (in the game code or as kayvalue), the entities is: 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).



Parameters and Effects
$specmap_texture
$specularcolor
$specmap_mode
$speculargloss
Bugs/Limitations
World geometry doesn't work with env_cascade_light
Unlike models - speculars doesn't work with env_cascade_light for world geometry.
Fullbright glitch with $specmap_mode
If values are used in $specmap_mode that were not thought out for use - surface will get fullbright and you'll get message in the console:
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)