This article relates to the game "Counter-Strike: Global Offensive". Click here for more information.

$decaltexture: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Added stipulation of using decaltexture)
No edit summary
 
(9 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Shaderparam|$decaltexture|game=Counter-Strike: Global Offensive|shader1=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.
{{CSGO topicon}}
{{bug|Using [[VBSP]]'s -StaticPropCombine parameter appears to break this effect on autocombined models in some cases.}}
{{This is a|shader parameter|name=$decaltexture|game=Counter-Strike: Global Offensive}} 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|hidetested=1|Using [[VBSP]]'s <code>-StaticPropCombine</code> parameter appears to break this effect on autocombined models in some cases.}}


[[File:decaltexture.jpg|thumb|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.]]
[[File:decaltexture.jpg|thumb|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 ==
== Parameters and Effects ==
{{MatParam|$decaltexture|texture|The decal texture.}}
{{MatParamDef|$decaltexture|texture|The decal texture.}}
{{MatParam|$decalblendmode|int|Set the decal's blend mode.}}
{{MatParamDef|$decalblendmode|int|Set the decal's blend mode.<ul>
: * 0 = Alpha Masked
<li>0 - Alpha Masked<li>1 - Multiplied{{note|If set to 1, {{ent|$phong}} will not function on the material.}}<li>2 - Modulate (functions like {{ent|DecalModulate}}, or Photoshop's Overlay blend mode){{note|Mode 2 expects sRGB input, not linear. This means ~0.73 gray acts as the mid point, instead of 0.5}}<li>3 - Additive</ol>
: * 1 = Multiplied
{{bug|hidetested=1|Mode 0 and 1 will not render in Hammer, however the basetexture will still render. Mode 2 and 3 will cause the model to render completely black in Hammer. It will still render correctly in game though.}}
: {{note|If set to 1, {{ent|$phong}} will not function on the material.}}
{{note|<code>$decalblendmode</code> MUST be defined in order for <code>$decaltexture</code> to work.}} }}
: * 2 = Modulate (functions like [[DecalModulate]], or Photoshop's Overlay blend mode)
{{MatParamDef|$modeldecalignorez|bool|If enabled, model decals will ignore depth.}}
: {{note|Mode 2 expects sRGB input, not linear. This means ~0.73 gray acts as the mid point, instead of 0.5}}
: * 3 = Additive
{{bug|Mode 0 and 1 will not render in Hammer, however the basetexture will still render. Mode 2 and 3 will cause the model to render completely black in Hammer. It will still appear correctly in game though.}}
{{note|$decalblendmode MUST be defined in order for $decaltexture to work.}}
{{MatParam|$modeldecalignorez|bool|If enabled, model decals will ignore depth.}}


[[Category:List of Shader Parameters|D]]
[[Category:Shader parameters|d]]

Latest revision as of 11:49, 23 August 2025

$decaltexture is a material shader parameter available in Counter-Strike: Global Offensive Counter-Strike: Global Offensive. 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.

Icon-Bug.pngBug: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

The decal texture.
Set the decal's blend mode.
  • 0 - Alpha Masked
  • 1 - Multiplied
    Note.pngNote:If set to 1, $phong will not function on the material.
  • 2 - Modulate (functions like DecalModulate, or Photoshop's Overlay blend mode)
    Note.pngNote:Mode 2 expects sRGB input, not linear. This means ~0.73 gray acts as the mid point, instead of 0.5
  • 3 - Additive
    Icon-Bug.pngBug:Mode 0 and 1 will not render in Hammer, however the basetexture will still render. Mode 2 and 3 will cause the model to render completely black in Hammer. It will still render correctly in game though.
    Note.pngNote:$decalblendmode MUST be defined in order for $decaltexture to work.
If enabled, model decals will ignore depth.