From Valve Developer Community
Revision as of 19:30, 1 July 2020 by Boba (talk | contribs) (this is indeed how it works)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Subrect is a shader used to render decals that are a portion of a larger 'sheet' of decal textures. This is used in most Valve games for decal sheets comprised of different impact types (wood, tile, concrete etc), but can also be used in Hammer for decals on world surfaces (the decal will preview incorrectly in Hammer but will appear correct in-game!)

Basic syntax

The Subrect shader uses $Material in place of $basetexture:

	"$Material"	"decals/decals_mod2x"
        "$Pos"	"384 128"
        "$Size"	"64 64"

Additional Parameters


$modelmaterial "decals/decal01" - replaces the material when applied to a model as opposed to the world

See also