SurfaceGGX: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Setting bug notice hidetested=1 param on page where the bug might not need tested in param specified)
No edit summary
Line 4: Line 4:


== Supported Parameters ==
== Supported Parameters ==
;{{MatParam|[[$basetexture]]||Diffuse texture.}}
;{{MatParamDef|[[$basetexture]]||Diffuse texture.}}
;{{MatParam|[[$bumpmap]]||Normal mapping. {{bug|hidetested=1|Animated bump maps aren't possible as the shader lacks the <code>$bumpframe</code> parameter.}} }}
;{{MatParamDef|[[$bumpmap]]||Normal mapping. {{bug|hidetested=1|Animated bump maps aren't possible as the shader lacks the <code>$bumpframe</code> parameter.}} }}
;{{MatParam|[[$color#Models|$color2]]||Color tinting.}}
;{{MatParamDef|[[$color#Models|$color2]]||Color tinting.}}
;{{MatParam|[[$detail]]||Detail texturing.}}
;{{MatParamDef|[[$detail]]||Detail texturing.}}
;{{MatParam|[[$envmap]]||Specular reflections.}}
;{{MatParamDef|[[$envmap]]||Specular reflections.}}
;{{MatParam|[[$alphatest]]||Alpha testing.}}
;{{MatParamDef|[[$alphatest]]||Alpha testing.}}


=== Metalness Parameters ===
=== Metalness Parameters ===


;{{MatParam|$metal|bool|Enables use of the green channel of <code>$phongexponenttexture</code>.}}
;{{MatParamDef|$metal|bool|Enables use of the green channel of <code>$phongexponenttexture</code>.}}
;{{MatParam|$phongexponenttexture|texture|Despite the name, this is a mask that defines the metalness of the material.}}
;{{MatParamDef|$phongexponenttexture|texture|Despite the name, this is a mask that defines the metalness of the material.}}


=== Specular/Gloss Parameters ===
=== Specular/Gloss Parameters ===


;{{MatParam|$pbr|bool|Enables PBR reflections.}}
;{{MatParamDef|$pbr|bool|Enables PBR reflections.}}
;{{MatParam|$masks|texture|A mask for specular and glossiness.  <code>$pbr</code> must be enabled to work.}}
;{{MatParamDef|$masks|texture|A mask for specular and glossiness.  <code>$pbr</code> must be enabled to work.}}


=== Misc. Parameters ===
=== Misc. Parameters ===


;{{MatParam|$fuzz|bool|Enables a asperity/fuzz scattering pass on the material.}}
;{{MatParamDef|$fuzz|bool|Enables a asperity/fuzz scattering pass on the material.}}
;{{MatParam|$fuzzmultiplier|float|Multiplier for the fuzz effect, default is 1.0.}}
;{{MatParamDef|$fuzzmultiplier|float|Multiplier for the fuzz effect, default is 1.0.}}
;{{MatParam|$roughnessmultiplier|float|Multiplier for roughness.  {{TODO|More detail, what is roughness?}} }}
;{{MatParamDef|$roughnessmultiplier|float|Multiplier for roughness.  {{TODO|More detail, what is roughness?}} }}
;{{MatParam|$subsurfacescattering|bool|Enables subsurface scattering on the material. {{TODO|More detail.}} }}
;{{MatParamDef|$subsurfacescattering|bool|Enables subsurface scattering on the material. {{TODO|More detail.}} }}
;{{MatParam|$disableenvmap|bool|Enabling disables <code>$envmap</code> reflections.  The shader will use <code>$envmap</code> by default even if it isn't specified, unless this is enabled.}}
;{{MatParamDef|$disableenvmap|bool|Enabling disables <code>$envmap</code> reflections.  The shader will use <code>$envmap</code> by default even if it isn't specified, unless this is enabled.}}


== Configuring the masks ==
== Configuring the masks ==

Revision as of 11:49, 23 August 2025

SurfaceGGX is a material shader available in the following Source engine games: Day of Infamy Day of Infamy , Insurgency Insurgency . It was first introduced in Day of Infamy and back ported to Insurgency. It supports PBR.

Icon-Bug.pngBug:This shader won't receive light properly from env_projectedtextures like the player's flashlight, instead making the material appear pure black. If the player is allowed to use a flashlight, the best case scenario is to only use this shader on props in lit up areas. This shader applied to weapon view models is safe from this however.  [todo tested in ?]

Supported Parameters

[[$basetexture|$basetexture]] <void>
Diffuse texture.
[[$bumpmap|$bumpmap]] <void>
Normal mapping.
Icon-Bug.pngBug:Animated bump maps aren't possible as the shader lacks the $bumpframe parameter.
[[$color2|$color2]] <void>
Color tinting.
[[$detail|$detail]] <void>
Detail texturing.
[[$envmap|$envmap]] <void>
Specular reflections.
[[$alphatest|$alphatest]] <void>
Alpha testing.

Metalness Parameters

$metal <boolean>
Enables use of the green channel of $phongexponenttexture.
$phongexponenttexture <texture>
Despite the name, this is a mask that defines the metalness of the material.

Specular/Gloss Parameters

$pbr <boolean>
Enables PBR reflections.
$masks <texture>
A mask for specular and glossiness. $pbr must be enabled to work.

Misc. Parameters

$fuzz <boolean>
Enables a asperity/fuzz scattering pass on the material.
$fuzzmultiplier <float>
Multiplier for the fuzz effect, default is 1.0.
$roughnessmultiplier <float>
Multiplier for roughness.
Todo: More detail, what is roughness?
$subsurfacescattering <boolean>
Enables subsurface scattering on the material.
Todo: More detail.
$disableenvmap <boolean>
Enabling disables $envmap reflections. The shader will use $envmap by default even if it isn't specified, unless this is enabled.

Configuring the masks

$phongexponenttexture

The RGB channels of $phongexponenttexture is configured as follows:

Channel Data
Red Glossiness (roughness inverted)
Green Metalness inverted
Blue Sub-surface scattering mask

$metal must be set to 1 in order to use the green channel.

Note.pngNote:$fuzz and $detailnormal use the inverse of the blue channel.

$masks

The RGB and alpha channels of $masks is configured as follows:

Channel Data
RGB Specular tint
Alpha Glossiness

$pbr must be enabled to make use of $masks.

See also

  • WorldGGX, similar shader used for brushes and displacements.