Character (shader)

From Valve Developer Community
Jump to: navigation, search
Character on left, VertexLitGeneric on right.

Character is a material shader available in <Counter-Strike: Global Offensive>. Shares most generic parameters of VertexLitGeneric. Takes advantage of mask textures to tune stuff like rimlighting, phong shading and other.

Supported Parameters

Textures & Masks

Diffuse mask.
Normal map.
Specular reflection mask.
Red channel - $rimlight mask
Green channel - Phong mask
Blue channel - Metalness mask
Alpha channel - $warpindex mask
Red channel - Shadow saturation mask
Green channel - Angle of Anisotropy
Blue channel - $envmap light scale
Alpha channel - Retroreflectivity
Phong warp texture.
To do

Unique Envmap Parameters

Note:In addition to all previous VertexLitGeneric parameters.
$envmaplightscale <float>
How much the surface's lightmap tints the specular reflection. A value between 0 (off) and 1 (no reflection with completely black lightmap) determines how much the reflection is tinted; values above 1 are permitted but seem to actually start inverting the effect.
$envmaplightscaleminmax <vector2>
Thresholds for the lightmap reflection tinting effect. Setting the minimum value higher increases the minimum light amount at which the reflection gets nerfed to nothing.

Unique Phong Parameters

Note:In addition to all previous VertexLitGeneric parameters.
$phongalbedoboost <float>
Phong albedo overbrightening factor.

Unique Rimlight Parameters

Note:In addition to all previous VertexLitGeneric parameters.
$rimlightalbedo <float>
Rimlight albedo overbrightening factor.
$rimlighttint <RGB matrix>
Color tint of the rimlight.
$fakerimboost <float>
Controls the strength of fake rimlight that doesn't use ambient color (visible in pitch black).
$fakerimtint <RGB matrix>
Color of the fake rimlight.
$fakerimlightscaleminmax <vector2>
To do.
$rimhaloboost <float>
To do.
$rimhalobounds <vector4>
To do.

Ambient Reflection Parameters

$ambientreflectionboost <float>
Controls the strength of rimlight like highlights on the edges of the model.
$ambientreflectionbouncecolor <vector4>
Color tint of the ambient reflections on the model.
To do Tints color, but uses vector 4?
$ambientreflectionbouncecenter <vector3>
To do.

Shadow Parameters

$shadowrimboost <float>
[Clarify]Controls the strength of rimlight in dark areas.
$shadowsaturation <float>
Controls the saturation of shadows.
$shadowsaturationbounds <vector4>
To do.
$shadowtint <vector4>
Tints the color of shadows on the model (when in dark area).
Note:Uses [R G B ShadowStrength] if shadow strength is 0, then the model won't be tinted in darkness.
$shadowcontrast <float>
Controls the contrast of shadows.

Miscellaneous Parameters

$hueshiftamount <float>
Changes the hue of the model.
$metalness <float>
To do.
Note:Doesn't do anything if $masks1 is used.
$warpindex <float>
Changes how much the light can spread on the model, similiar to half lambert.
Note:Doesn't do anything if $masks1 is used.
$anisotropyamount <float>
Controls how much anisotropic lighting tints the model.