Decals

From The DarkMod Wiki
Jump to: navigation, search

written by Flanders

Introduction

Decal textures are used to add a layer of partially transparent texture to another surface. For example: dirt on the ground, stains on a wall or Grime Corners. When you take a look at the decal textures in the darkmod folder you'll see that they have a white, yellow or purple background, those areas are transparent.

Decal creation

To create decals, select the surface you want to make a decal for (in select face mode or with SHIFT+CTRL+Click the left mouse button). Press the “create Decals for selected Faces” button, it will create a patch for each selected face, which will be exactly in the same plane. Another way to create a decal is create patch yourself and place it were you want. Assign a texture to it from the Media browser, the texture browser or with the surface inspector.

Decal placement

Decals can be placed co-planar on surfaces or with a tiny offset. During development of your mission it might be useful to place decals with a small offset. This way they don't cause z-fighting errors in dark radiant. Drawback is that the player camera could get in between the decal and the actual face, which can happen if the player is leaning into that wall or getting real close. Co-planar decals do NOT cause z-fighting errors in game, they use a blending filter so they blend with the surface they are placed on. However, if you place a texture on it without a blend filter it will cause a z-fighting error as any other two colliding surfaces. All the decals in the darkmod/decals and in the Doom3/decals folders have a blend filter.

Some other decal properties

  • Decals do not cast shadows.
  • Decals are nonsolid, the player won't collide with them, weapons go right through them.
  • Decal materials won't seal against the void.
  • Decal textures can be applied to a brush (if there is any use for it).

Creating decal textures

If you want to create your own textures for decals, f.i. from existing models, see here for a tutorial.