$decaltexture: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 7: Line 7:
{{MatParam|$decaltexture|texture|The decal texture.}}
{{MatParam|$decaltexture|texture|The decal texture.}}
{{MatParam|$decalblendmode|int|Set the decal's blend mode.}}
{{MatParam|$decalblendmode|int|Set the decal's blend mode.}}
* 0 = Alpha Masked
: * 0 = Alpha Masked
* 1 = Multiplied
: * 1 = Multiplied
* 2 = Modulate (functions like [[DecalModulate]], or Photoshop's Overlay blend mode)
: * 2 = Modulate (functions like [[DecalModulate]], or Photoshop's Overlay blend mode)
: * 3 = Additive
: {{note|Mode 2 expects sRGB input, not linear. This means ~0.73 gray acts as the mid point, instead of 0.5}}
: {{note|Mode 2 expects sRGB input, not linear. This means ~0.73 gray acts as the mid point, instead of 0.5}}
: {{note|If set to 1, {{ent|$phong}} will not function on the material.}}
: {{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.}}
: {{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.}}
* 3 = Additive
: {{note|If set to 1, {{ent|$phong}} will not function on the material.}}
{{MatParam|$modeldecalignorez|bool|If enabled, model decals will ignore depth.}}
{{MatParam|$modeldecalignorez|bool|If enabled, model decals will ignore depth.}}


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

Revision as of 00:49, 9 September 2020

Template:Shaderparam 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.  [todo tested in ?]
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 $decalblendmode

* 0 = Alpha Masked
* 1 = Multiplied
* 2 = Modulate (functions like DecalModulate, or Photoshop's Overlay blend mode)
* 3 = Additive
Note.pngNote:Mode 2 expects sRGB input, not linear. This means ~0.73 gray acts as the mid point, instead of 0.5
Note.pngNote:If set to 1, $phong will not function on the material.
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 appear correctly in game though.  [todo tested in ?]

$modeldecalignorez