Skip to main content

Material Library

Overview

Materials are either stored in separate file (.mat) or embedded into model files (.3db, .cmp, .dfm, etc).

Certain assets cannot have reference to external material file and will require materials to be embedded directly in model file, such as starspheres, cutscene props and deformable models.

Material types

TypeAlphaDescription
DcDtNoDiffuse color + Diffuse texture.
DcDtTwoNoTwo-sided variant of DcDt.
DcDtEcNoDiffuse color + Diffuse texture + Emission color.
DcDtEcTwoNoTwo-sided variant of DcDtEc.
DcDtOcOtYesDiffuse color + Diffuse texture + Opacity color + Opacity texture.
DcDtOcOtTwoYesTwo-sided variant of DcDtOcOt.
DcDtEcOcOtYesDiffuse color + Diffuse texture + Emission color + Opacity color + Opacity texture.
DcDtEcOcOtTwoYesTwo-sided variant of DcDtEcOcOt.
DcDtEtNoDiffuse color + Diffuse texture + Emission texture.
EcEtNoEmission color + Emission texture.
NebulaYesDiffuse texture tinted by vertex color with blending (ADD, SRCALPHA, ONE).
NebulaTwoYesTwo-sided variant of Nebula.
BtDetailMapMaterialNoDiffuse texture with detail texture blended in overlay mode. Detail texture uses second UV texture mapping set.
BtDetailMapMaterialTwoNoTwo-sided variant of DetailMaterial.
NomadMaterialYesSpecial material for nomad ships.
NomadMaterialNoBendyYesDitto.
GlassMaterialYesTransparent material used for cockpit.
GFGlassMaterialYesDitto.
HighGlassMaterialYesDitto.
PlanetWaterMaterialYesMultiply blending mode material.
AtmosphereMaterialYes
ExclusionZoneMaterialYesMaterial for exclusion zone shells.
HUDIconMaterialYesMaterial for HUD icons.
HUDAnimMaterialYesAnimated material for HUD. Animation is toggled in settings.
NullMaterialNoFallback material.
DetailMapMaterialNo
DetailMap2Dm1Msk2PassMaterialNo
IllumDetailMapMaterialNo
Masked2DetailMapMaterialNo
  • NomadMaterial and NomadMaterialNoBendy do not display when environment map is used for the object.
  • ❗ Material type can be overridden by matching regexp in [MaterialMap] of dacom.ini.

When model uses both transparent and non-transparent (opaque) materials it should be multi-part compound and any mesh groups using transparent material(s) should be kept in parts separate from mesh groups using opaque materials, i.e. transparent cockpit glass should be in part separate from hull it is attached to. Mesh groups with opaque materials are drawn front to back, afterwards mesh groups with transparent materials are drawn back to front with depth buffer write disabled.

Material properties

NameTypeDescription
Acfloat[3]Ambient color.
Dcfloat[3]Diffuse color.
OcfloatOpacity color (alpha).
Ecfloat[3]Emission color.
Scfloat[3]Specular color.
SpfloatSpecular power.
Dt_namestringDiffuse texture name.
Dt_flagsuint32Diffuse texture wrap flags.
Et_namestringEmission texture name.
Et_flagsuint32Emission texture wrap flags.
Bt_namestringDetail texture name.
Bt_flagsuint32Detail texture wrap flags.
Nt_namestringNomad texture name.
Nt_flagsuint32Nomad texture wrap flags.
AlphafloatOpacity level.
FadefloatSteep view angle fade factor.
ScalefloatVertex offset scaling?
Dm_namestringDiffuse mask texture name.
Dm_flagsuint32Diffuse mask texture wrap flags.
TileRatefloatDiffuse mask texture tiling multiplier.
Dm0_namestringDiffuse mask 0 texture name.
Dm0_flagsuint32Diffuse mask 0 texture wrap flags.
TileRate0floatDiffuse mask 0 texture tiling multiplier.
Dm1_namestringDiffuse mask 1 texture name.
Dm1_flagsuint32Diffuse mask 1 texture wrap flags.
TileRate1floatDiffuse mask 1 texture tiling multiplier.
flip uuint32Flip texture horizontally.
flip vuint32Flip texture vertically.
  • Ac is used in AtmosphereMaterial, but can be applied to many other materials to override ambient color from scene.
  • Oc is used in any transparent material.
  • Ec is used in DcDtEc, DcDtEcOcOt, EcEt.
  • ❗ There is no "Ot_name" or "Ot_flags" since transparency is taken from alpha channel of texture formats which support transparency.
  • Et_name and Et_flags are used in DcDtEt and EcEt.
  • Bt_name and Bt_flags are used in BtDetailMapMaterial and BtDetailMapMaterialTwo.
  • Nt_name and Nt_flags are used in NomadMaterial and NomadMaterialNoBendy.
  • Alpha, Fade and Scale are used in AtmosphereMaterial.
  • Dm_name, Dm_flags and TileRate are used in DetailMapMaterial.
  • Dm0_name, Dm0_flags and TileRate0 are used in DetailMap2Dm1Msk2PassMaterial, IllumDetailMapMaterial, Masked2DetailMapMaterial.
  • Dm1_name, Dm1_flags and TileRate1 are used in DetailMap2Dm1Msk2PassMaterial, IllumDetailMapMaterial, Masked2DetailMapMaterial.

Material animation

Material animation is stored in model file and permits simple UV offset and scaling looped keyframe animation.

NameTypeDescription
MACountuint32Number of MADeltas keyframes.
MADeltasvaryingUV offset and scale velocity keyframes.
MAKeysvaryingUV offset and scale keyframes.
MAFlagsuint32Animation flags.

Each keyframe in MADeltas:

NameTypeDescription
timefloatKeyframe time.
uOffsetSpeedfloatU tiling offset velocity.
vOffsetSpeedfloatV tiling offset velocity.
uScaleSpeedfloatU tiling scale velocity.
vScaleSpeedfloatV tiling scale velocity.

Each keyframe in MAKeys:

NameTypeDescription
uOffsetfloatU start offset.
vOffsetfloatV start offset.
uScalefloatU start scale.
vScalefloatV start scale.
  • MAKeys keyframes count will be one less MACount. First keyframe is implicit state of original UV values.