Cheap Decals

From Mod Wiki

Cheap decals are spawned from the game script instead of via the effect system. They are cheaper to maintain than the "big" decals, the disadvantage is they only work for relatively unimportant decals like small bullet holes. Big grenade blasts for example will just look ugly (as they would clip into a surface if it wasn't flat).

Each decal declaration defines a single type of impact, "bullet/wood" "blaster/metal" the decal specifies what material to use for rendering the decal and what part of the material's texture should be used. There can be several decals painted into a single texture (i.e. a texture sheet) all those decals will then be rendered in one batch. Hence it is recommended to put as many decals as possible on a single texture sheet.

General syntax

Decals are specified just like any other declaration in the game, the files have a .decal extension and are stored in the decals directory.

Sample decal declaration

Let's start with a quick example...

 decal bullets/metal {
 	material	"textures/particles/decals/sheet"
 	lifeTime	15
 	size		4,6
 	
 	gridSize	16,16
 	image 		0,0,1,1
 	image		3,0,1,1
 }
  • material - Specify what material to render the decal with.
  • lifeTime - Specify how long the decal stays in the world (in seconds).
  • size - Specify the minimum and the maximum size of the decal (a random size between these two will then be chosen).
  • gridSize - Specify the number of grid cells in the texture sheet. (All decals using the same texture sheet should specify the same size for this).
  • image - Specify the image rectangle of the decal in grid units. This can be any rectangle. If there are several images specified in a decal a random image will be chosen every time a decal is spawned.
    • The way the numbers are set up is left,right,width,height