The game's decal system is responsible for rendering bullet holes, blood splatter, explosion marks, and other flat textures applied over over BSP surfaces (decals cannot appear on objects). Decal tags describe the appearance and lifetime of these effects.
Effect decals
Decals are most commonly created dynamically from effects, such as explosions and bullet impacts. In these cases, it is recommended to give the decal a maximum lifetime to avoid poor framerates.
Environment decals
A scenario can also contain permanent decals placed throughout the environment. These can be placed in Sapien under the game data section.
Decal meshes
Although often created as quads, the game may generate more complex decal meshes to conform to the underlying geometry. Vertices of decal meshes typically stand off from their background with a small margin to avoid Z-fighting, but the distance is not consistent.
Structure and fields
Field |
Type |
Comments |
flags |
bitfield(16) |
|
Flag | Mask | Comments | geometry inherited by next decal in chain | 0x1 | | interpolate color in hsv | 0x2 | | more colors | 0x4 | | no random rotation | 0x8 | | water effect | 0x10 | | sapien snap to axis | 0x20 | | sapien incremental counter | 0x40 | | animation loop | 0x80 | | preserve aspect | 0x100 | | |
type |
enum |
|
Option | Value | Comments | scratch | 0x0 | | splatter | 0x1 | | burn | 0x2 | | painted sign | 0x3 | | |
layer |
enum |
|
Option | Value | Comments | primary | 0x0 | | secondary | 0x1 | | light | 0x2 | | alpha tested | 0x3 | | water | 0x4 | | |
|
pad(2) |
|
next decal in chain |
Reference? |
|
radius |
f32 (world units) (min & max) |
- Default value: 0.125,0.125
|
|
pad(12) |
|
intensity |
Fraction: f32 (min & max) |
- Maximum: 1
- Default value: 1,1
|
color lower bounds |
ColorRGB (3) - red:
f32 - green:
f32 - blue:
f32 |
|
color upper bounds |
ColorRGB (3) - red:
f32 - green:
f32 - blue:
f32 |
|
|
pad(12) |
|
animation loop frame |
u16 |
|
animation speed |
u16 (ticks per frame) |
|
|
pad(28) |
|
lifetime |
f32 (seconds) (min & max) |
|
decay time |
f32 (seconds) (min & max) |
|
|
pad(12) |
|
|
pad(40) |
|
|
pad(2) |
|
|
pad(2) |
|
framebuffer blend function |
enum |
|
Option | Value | Comments | alpha blend | 0x0 | | multiply | 0x1 | | double multiply | 0x2 | | add | 0x3 | | subtract | 0x4 | | component min | 0x5 | | component max | 0x6 | | alpha multiply add | 0x7 | | |
|
pad(2) |
|
|
pad(20) |
|
map |
Reference? |
|
|
pad(20) |
|
maximum sprite extent |
f32 |
|
|
pad(4) |
|
|
pad(8) |
|
This information was partially generated using Invader tag definitions.
Acknowledgements
Thanks to the following individuals for their research or contributions to this topic:
- Kavawuvi (Invader tag definitions)
- MosesOfEgypt (Tag structure research)