Subrect

From Valve Developer Community
Jump to navigation Jump to 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 comprising 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:

Subrect
{
	"$Material"	"decals/decals_mod2x"
        "$Pos"	"384 128"
        "$Size"	"64 64"
}

Additional Parameters

$decalscale

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

See also