gbxmodel

🚧 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 Gearbox model tag contains the render models (LODs) and shader_model references for objects such as vehicles, scenery, and weapons among others. It is not collideable nor animated on its own, and objects may reference additional model_collision_geometry and model_animations tags.

Don't confuse this tag with the Xbox-only model, which Gearbox modified for the PC port. It is therefore used in all derivatives of that port, like Mac, Demo, and MCC. Unlike the Xbox version, the Gearbox model uses uncompressed vertices.

Shaders #

Each "part" of a model can reference a different shader, like the Warthog's windscreen using a transparent shader while its body uses a shader_model. While a model can technically reference any kind of shader, referencing a shader_environment (used for BSPs) is not recommended because the game does not support all of its features and it renders incorrectly in fog in Custom Edition.

Markers #

...

Structure and fields #

Field Type Comments
flags bitfield(32)
Flag Mask Comments
blend shared normals 0x1
parts have local nodes 0x2
ignore skinning 0x4
node list checksum i32
super high detail cutoff f32 (pixels)
high detail cutoff f32 (pixels)
medium detail cutoff f32 (pixels)
low detail cutoff f32 (pixels)
super low detail cutoff f32 (pixels)
super low detail node count u16 (nodes)
low detail node count u16 (nodes)
medium detail node count u16 (nodes)
high detail node count u16 (nodes)
super high detail node count u16 (nodes)
pad(2)
pad(8)
base map u scale f32
  • Default value: 1.
base map v scale f32
  • Default value: 1.
pad(116)
markers Block?
  • Internal to the tag and may be hidden in tools.
Field Type Comments
name char[32]
magic identifier i16
pad(2)
pad(16)
instances Block?
Field Type Comments
region index u8
permutation index u8
node index u8
pad(1)
translation
Point3D
  • x: f32
  • y: f32
  • z: f32
rotation
Quaternion
  • i: f32
  • j: f32
  • k: f32
  • w: f32
nodes Block?
  • Maximum: 255
Field Type Comments
name char[32]
next sibling node index Index (nodes)
first child node index Index (nodes)
parent node index Index (nodes)
pad(2)
default translation
Point3D
  • x: f32
  • y: f32
  • z: f32
default rotation
Quaternion
  • i: f32
  • j: f32
  • k: f32
  • w: f32
node distance from parent f32
pad(32)
scale f32 (little endian?)
  • Only set when the tag is compiled into a map cache.
rotation

Matrix3x3 (little endian?): elements (9): f32

  • Only set when the tag is compiled into a map cache.
translation
Point3D (little endian?)
  • x: f32
  • y: f32
  • z: f32
  • Only set when the tag is compiled into a map cache.
regions Block?
  • Maximum: 255
Field Type Comments
name char[32]
pad(32)
permutations Block?
  • Maximum: 255
Field Type Comments
name char[32]
flags bitfield(32)
Flag Mask Comments
cannot be chosen randomly 0x1
permutation number u16 (Index endian?)
  • Only set when the tag is compiled into a map cache.
pad(2)
pad(24)
super low Index (geometries)
low Index (geometries)
medium Index (geometries)
high Index (geometries)
super high Index (geometries)
pad(2)
markers Block?
Field Type Comments
name char[32]
node index Index (nodes)
pad(2)
rotation
Quaternion
  • i: f32
  • j: f32
  • k: f32
  • w: f32
translation
Point3D
  • x: f32
  • y: f32
  • z: f32
pad(16)
geometries Block?
  • Maximum: 65535
Field Type Comments
flags bitfield(32)
Flag Mask Comments
unused 0x1
pad(32)
parts Block?
Field Type Comments
flags bitfield(32)
Flag Mask Comments
stripped internal 0x1
zoner 0x2
shader index Index (shaders)
prev filthy part index u8
  • Only set when the tag is compiled into a map cache.
next filthy part index u8
  • Only set when the tag is compiled into a map cache.
centroid primary node Index: u16
  • Only set when the tag is compiled into a map cache.
centroid secondary node Index: u16
  • Only set when the tag is compiled into a map cache.
centroid primary weight Fraction: f32
  • Only set when the tag is compiled into a map cache.
centroid secondary weight Fraction: f32
  • Only set when the tag is compiled into a map cache.
centroid
Point3D
  • x: f32
  • y: f32
  • z: f32
uncompressed vertices Block?
  • Not included when the tag is compiled into a map cache.
Field Type Comments
position
Point3D
  • x: f32
  • y: f32
  • z: f32
normal
Vector3D
  • i: f32
  • j: f32
  • k: f32
binormal
Vector3D
  • i: f32
  • j: f32
  • k: f32
tangent
Vector3D
  • i: f32
  • j: f32
  • k: f32
texture coords
Point2D
  • x: f32
  • y: f32
node0 index Index (nodes)
node1 index Index (nodes)
node0 weight f32
node1 weight f32
compressed vertices Block?
  • Not included when the tag is compiled into a map cache.
Field Type Comments
position
Point3D
  • x: f32
  • y: f32
  • z: f32
normal u32
binormal u32
tangent u32
texture coordinate u i16
texture coordinate v i16
node0 index i8
node1 index i8
node0 weight u16
triangles Block?
  • Not included when the tag is compiled into a map cache.
Field Type Comments
vertex0 index Index (uncompressed vertices)
vertex1 index Index (uncompressed vertices)
vertex2 index Index (uncompressed vertices)
do not crash the game u32 (little endian?)
  • Only set when the tag is compiled into a map cache.
triangle count u32 (little endian?)
  • Only set when the tag is compiled into a map cache.
triangle offset u32 (little endian?)
  • Only set when the tag is compiled into a map cache.
triangle offset 2 u32 (little endian?)
  • Only set when the tag is compiled into a map cache.
do not screw up the model u32 (little endian?)
  • Only set when the tag is compiled into a map cache.
vertex count u32 (little endian?)
  • Only set when the tag is compiled into a map cache.
pad(4)
bullshit u32 (little endian?)
  • Only set when the tag is compiled into a map cache.
vertex offset u32
pad(1)
pad(1)
pad(1)
num nodes u8
local node indices u8 x24
shaders Block?
Field Type Comments
permutation Index: u16
pad(2)
pad(12)

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)