Difference between revisions of "$decaltexture"

From Valve Developer Community
Jump to: navigation, search
m (Added note for using specific $decalblendmode setting)
(Added $modeldecalignorez and some additional decal blending modes)
Line 5: Line 5:
  
 
== Parameters and Effects ==
 
== Parameters and Effects ==
{{MatParam|$decaltexture|texture|The path to the decal texture.}}
+
{{MatParam|$decaltexture|texture|The decal texture.}}
{{MatParam|$decalblendmode|bool|Controls blending of decal. 0 is alpha masked, 1 is multiplied.}}
+
{{MatParam|$decalblendmode|bool|Set the decal's blend mode. Mode 0 is alpha masked, mode 1 is multiplied, mode 2 is multiplied x2, 3 is additive.}}
: {{note|If set to 1, [[$phong]] will not function on the material.}}
+
: {{note|If set to 1, {{ent|$phong}} will not function on the material.}}
 +
{{MatParam|$modeldecalignorez|bool|If enabled, model decals will ignore depth.}}
  
[[Category:List of Shader Parameters|N]]
+
[[Category:List of Shader Parameters|D]]

Revision as of 19:50, 28 August 2020

$decaltexture is a material shader parameter available in <Counter-Strike: Global Offensive> Counter-Strike: Global Offensive for VertexLitGeneric. It allows for a second UV channel to be defined for a model, allowing a decal texture to be placed on top of the base material. To use the parameter, the MDL must have been compiled from an FBX file and have a second UV channel defined.

Bug.png Bug: Using VBSP's -StaticPropCombine parameter appears to break this effect on autocombined models in some cases.
Here, each label on the crates is laid out on a separate UV channel to that of the main texture – this allows easy and efficient reuse of the same labels/decals on many different props without losing texture resolution.

Parameters and Effects

$decaltexture <texture>
The decal texture.
$decalblendmode <boolean>
Set the decal's blend mode. Mode 0 is alpha masked, mode 1 is multiplied, mode 2 is multiplied x2, 3 is additive.
Note.png Note: If set to 1, $phong will not function on the material.
$modeldecalignorez <boolean>
If enabled, model decals will ignore depth.