Decals

From ZDoom Wiki

Jump to: navigation, search

Decals have often been a very confusing topic, with lots of incorrect information spread around. Hopefully this page will iron these out.

Contents

Overview

Decals are images that are placed on walls, overlaying the texture. They are often generated by weapons or projectiles to show battle damage, but can have other creative uses as well.

There are two types of decals:

  • A normal decal is a palettized image that will display in color.
  • An Alpha-map decal is an image that is drawn at varying levels of transparency. It contains no color information, but color can be assigned with the DECALDEF lump.

Creating a Decal

  • Decals do not need to be located in any special position inside the WAD.
  • The Offset position determines where the decal will be drawn from.

Normal Decal

To create a normal decal, you need only load an image as you would any normal graphic resource. This should be a palettized image. If the image's palette contains colors that aren't available to the game you will use the decal with, you are at the mercy of ZDoom's palette remapping. The result may or may not look good. If you only intend to use the decal with one game, then it is advisable to convert it to the game's palette before you save it.

Use the SetPNG utility's -grab option to set the image's offset (see below, but omit '-alph').

Alpha-Map Decal

Creating an alpha-map decal requires a few extra steps. First you must create an 8-bit grayscale image, with white as most-visible and black as transparent. Save this image as a grayscale PNG-8. If your image editor cannot directly save 8-bit grayscale images, you can convert the output using ImageMagick's 'convert' utility:

 convert -colors 256 -colorspace GRAY <infile.png> <outfile.png>

ZDoom requires some extra data to be stored with the decal, otherwise it will not paint properly. To include this data, you must use the SetPNG utility. Run the utility and specify the -alph parameter. The image offset is also specified with this tool using the -grab parameter:

 setpng -alph -grab <x> <y> <infile.png> <outfile.png>

Uses

  • All decals need to be specified in the DECALDEF lump, no matter what the intended use is.
  • Decals can be created by weapons, or projectiles. To set these, use a special section in the DECALDEF or define a property for the actor.
  • Decals can be inserted directly onto walls in maps. See Decal Thing.
Personal tools