$specmap texture: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(Replaced the pictures with compressed versions.)
Line 1: Line 1:
{{langsp}}
{{langsp}}
[[File:NewSpecular.png|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 [[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:bs_fy_basement_floor01_spec.png |An example of [[specularmap]] from {{bmsbs|4}}.
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.png |$specularcolor - 1 1 1.
File:1 1 1=.jpg|$specularcolor - 1 1 1.
File:1 0 0.png |$specularcolor - 1 0 0.
File:1 0 0=.jpg|$specularcolor - 1 0 0.
File:1 0 1.png |$specularcolor - 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.png |$specmap_mode - 0. Seems to ignore $specmap_texture.
File:mode 0=.jpg|$specmap_mode - 0. Seems to ignore $specmap_texture.
File:mode 1.png |$specmap_mode - 1. Seems to use $specmap_texture as glossiness map.
File:mode 1=.jpg|$specmap_mode - 1. Seems to use $specmap_texture as glossiness map.
File:mode 2.png |$specmap_mode - 2. Seems to use $specmap_texture as tint map.
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 0 10.png |$specmap_mode - 0. $speculargloss - 10
File:mode 2 10=.jpg|$specmap_mode - 2. $speculargloss - 10
File:mode 0 100.png |$specmap_mode - 0. $speculargloss - 100
File:Mode_2=.jpg|$specmap_mode - 2. $speculargloss - 100
File:mode 0 500.png |$specmap_mode - 0. $speculargloss - 500
File:mode 2 500=.jpg|$specmap_mode - 2. $speculargloss - 500
 
File:mode 1 10.png |$specmap_mode - 1. $speculargloss - 10
File:mode 1 100.png |$specmap_mode - 1. $speculargloss - 100
File:mode 1 500.png |$specmap_mode - 1. $speculargloss - 500
 
File:mode 2 10.png |$specmap_mode - 2. $speculargloss - 10
File:Mode_2.png |$specmap_mode - 2. $speculargloss - 100
File:mode 2 500.png |$specmap_mode - 2. $speculargloss - 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.png|{{nbsp}}
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.png|{{nbsp}}
File: HAHAHAHAHAHAHAHAAH=.jpg|{{nbsp}}
</gallery>
</gallery>



Revision as of 03:10, 23 June 2024

English (en)Translate (Translate)
New specular shader, example in bs_c3m0d. 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 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).

Confirm:Is this full list of entities ?
Warning.pngWarning: This is pretty expensive shader for video cards, in large quantities may not cause optimization problems, but it will heat up your video card very much. Use wisely.
Icon-Bug.pngBug:Doesn't work with VertexLitGeneric if $phong is enabled.  [todo tested in ?]
Black Mesa Level Creation

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:

************************************************* Shader 'shaders\fxc\gbbrush_ps30.vcs' - Couldn't load combo 184025856 of shader (dyn=384) static combos: BASETEXTURE2=0 BUMPMAP=1 BUMPMAP2=0 CUBEMAP=0 ENVMAPMASK=0 BASEALPHAENVMAPMASK=0 SELFILLUM=0 NORMALMAPALPHAENVMAPMASK=0 WARPLIGHTING=0 FANCY_BLENDING=0 SEAMLESS=0 DETAIL_BLEND_MODE=0 MOSS=0 NEW_SPECMAP=0 SHADER_SPECIAL_MODE=0 ************************************************* ************************************************* Shader 'shaders\fxc\gbbrush_gbuffer_ps30.vcs' - Couldn't load combo 48 of shader (dyn=4) static combos: ALPHACLIP=0 NEW_SPECMAP=0 *************************************************

See also