shader_model

🚧 This article is a stub. You can help expand it by submitting content in pull requests or issues in this wiki's source repo.

The shader_model tag is used for opaque materials on object models. It supports features like map animation, detail maps, specularity, self-illumination, and colour change (e.g. for armour ranks/teams).

Singleplayer units have their colors set in their actor_variant tags. In multiplayer, players' armor colors are hard-coded.

Structure and fields #

This tag inherits fields from shader which are not shown here. See the parent's page for more information. The following information is unique to the shader_model tag.

Field Type Comments
shader model flags bitfield(16)
Flag Mask Comments
detail after reflection 0x1
two sided 0x2
not alpha tested 0x4
alpha blended decal 0x8
true atmospheric fog 0x10
disable two sided culling 0x20
pad(2)
pad(12)
translucency Fraction: f32
pad(16)
change color source enum
Option Value Comments
none 0x0
a 0x1
b 0x2
c 0x3
d 0x4
pad(2)
pad(28)
shader model more flags bitfield(16)
Flag Mask Comments
no random phase 0x1
pad(2)
color source enum
Option Value Comments
none 0x0
a 0x1
b 0x2
c 0x3
d 0x4
animation function enum
Option Value Comments
one 0x0
zero 0x1
cosine 0x2
cosine variable period 0x3
diagonal wave 0x4
diagonal wave variable period 0x5
slide 0x6
slide variable period 0x7
noise 0x8
jitter 0x9
wander 0xa
spark 0xb
animation period f32 (seconds)
  • Default value: 1.
animation color lower bound
ColorRGB
  • red: f32
  • green: f32
  • blue: f32
animation color upper bound
ColorRGB
  • red: f32
  • green: f32
  • blue: f32
pad(12)
map u scale f32
  • Default value: 1.
map v scale f32
  • Default value: 1.
pad(8)
pad(8)
detail function enum
Option Value Comments
double biased multiply 0x0
multiply 0x1
double biased add 0x2
detail mask enum
Option Value Comments
none 0x0
reflection mask inverse 0x1
reflection mask 0x2
self illumination mask inverse 0x3
self illumination mask 0x4
change color mask inverse 0x5
change color mask 0x6
multipurpose map alpha inverse 0x7
multipurpose map alpha 0x8
detail map scale f32
  • Default value: 1.
detail map v scale f32
  • Default value: 1.
pad(12)
u animation source enum
Option Value Comments
none 0x0
a out 0x1
b out 0x2
c out 0x3
d out 0x4
u animation function enum
Option Value Comments
one 0x0
zero 0x1
cosine 0x2
cosine variable period 0x3
diagonal wave 0x4
diagonal wave variable period 0x5
slide 0x6
slide variable period 0x7
noise 0x8
jitter 0x9
wander 0xa
spark 0xb
u animation period f32 (seconds)
  • Default value: 1.
u animation phase f32
u animation scale f32 (repeats)
  • Default value: 1.
v animation source enum
Option Value Comments
none 0x0
a out 0x1
b out 0x2
c out 0x3
d out 0x4
v animation function enum
Option Value Comments
one 0x0
zero 0x1
cosine 0x2
cosine variable period 0x3
diagonal wave 0x4
diagonal wave variable period 0x5
slide 0x6
slide variable period 0x7
noise 0x8
jitter 0x9
wander 0xa
spark 0xb
v animation period f32 (seconds)
  • Default value: 1.
v animation phase f32
v animation scale f32 (repeats)
  • Default value: 1.
rotation animation source enum
Option Value Comments
none 0x0
a out 0x1
b out 0x2
c out 0x3
d out 0x4
rotation animation function enum
Option Value Comments
one 0x0
zero 0x1
cosine 0x2
cosine variable period 0x3
diagonal wave 0x4
diagonal wave variable period 0x5
slide 0x6
slide variable period 0x7
noise 0x8
jitter 0x9
wander 0xa
spark 0xb
rotation animation period f32 (seconds)
  • Default value: 1.
rotation animation phase f32
rotation animation scale f32 (degrees)
  • Default value: 360.
rotation animation center
Point2D
  • x: f32
  • y: f32
pad(8)
reflection falloff distance f32 (world units)
reflection cutoff distance f32 (world units)
perpendicular brightness Fraction: f32
  • Maximum: 1
perpendicular tint color
ColorRGB
  • red: f32
  • green: f32
  • blue: f32
parallel brightness Fraction: f32
  • Maximum: 1
parallel tint color
ColorRGB
  • red: f32
  • green: f32
  • blue: f32
pad(16)
unknown f32 (little endian?)
  • Only set when the tag is compiled into a map cache.
pad(16)
pad(32)

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)