DecalData

consoledoc.h

A datablock describing an individual decal.

More...

Decal

float

Width and height of the decal in meters before scale is applied.

string

Material to use for this decal.

int

Time (in milliseconds) before this decal will be automatically deleted.

int

Time (in milliseconds) over which to fade out the decal before deleting it at the end of its lifetime.

Rendering

float

LOD value - size in pixels at which decals of this type begin to fade out.

float

LOD value - size in pixels at which decals of this type are fully faded out.

char

Default renderPriority for decals of this type (determines draw order when decals overlap).

float

The angle in degrees used to clip geometry that faces away from the decal projection direction.

Texturing

int

Index of the texture rectangle within the imagemap to use for this decal.

bool

If true, a random frame from the imagemap is selected for each instance of the decal.

int

Number of individual frames in the imagemap (maximum 16).

int

Number of rows in the supplied imagemap.

int

Number of columns in the supplied imagemap.

RectF

An array of RectFs (topleft.x topleft.y extent.x extent.y) representing the UV coordinates for each frame in the imagemap.

Public Functions

void

Recompute the imagemap sub-texture rectangles for this DecalData.

Detailed Description

A datablock describing an individual decal.

The textures defined by the decal Material can be divided into multiple rectangular sub-textures as shown below, with a different sub-texture selected by all decals using the same DecalData (via frame) or each decal instance (via randomize). Example of a Decal imagemap

datablock DecalData(BulletHoleDecal)
{
   material = "DECAL_BulletHole";
   size = "5.0";
   lifeSpan = "50000";
   randomize = "1";
   texRows = "2";
   texCols = "2";
   clippingAngle = "60";
};

see:

Decal

float size 

Width and height of the decal in meters before scale is applied.

string Material 

Material to use for this decal.

int lifeSpan 

Time (in milliseconds) before this decal will be automatically deleted.

int fadeTime 

Time (in milliseconds) over which to fade out the decal before deleting it at the end of its lifetime.

Rendering

float fadeStartPixelSize 

LOD value - size in pixels at which decals of this type begin to fade out.

This should be a larger value than fadeEndPixelSize. However, you may also set this to a negative value to disable lod-based fading.

float fadeEndPixelSize 

LOD value - size in pixels at which decals of this type are fully faded out.

This should be a smaller value than fadeStartPixelSize.

char renderPriority 

Default renderPriority for decals of this type (determines draw order when decals overlap).

float clippingAngle 

The angle in degrees used to clip geometry that faces away from the decal projection direction.

Texturing

int frame 

Index of the texture rectangle within the imagemap to use for this decal.

bool randomize 

If true, a random frame from the imagemap is selected for each instance of the decal.

int textureCoordCount 

Number of individual frames in the imagemap (maximum 16).

int texRows 

Number of rows in the supplied imagemap.

Use texRows and texCols if the imagemap frames are arranged in a grid; use textureCoords to manually specify UV coordinates for irregular sized frames.

int texCols 

Number of columns in the supplied imagemap.

Use texRows and texCols if the imagemap frames are arranged in a grid; use textureCoords to manually specify UV coordinates for irregular sized frames.

RectF textureCoords [16]

An array of RectFs (topleft.x topleft.y extent.x extent.y) representing the UV coordinates for each frame in the imagemap.

note:

This field should only be set if the imagemap frames are irregular in size. Otherwise use the texRows and texCols fields and the UV coordinates will be calculated automatically.

Public Functions

postApply()

Recompute the imagemap sub-texture rectangles for this DecalData.

// Inform the decal object to reload its imagemap and frame data.
%decalData.texRows = 4;
%decalData.postApply();