benilla-re systems structs docs

M2Element

struct · models · 64 bytes

Meaning
Holds one drawable of a scene frame: its kind, instance, batch, depth keys and shader ids
Confidence
verified, proof one
Finding
models/scene#element-collection

Finding: Element collection in models: the scene

Each ready instance on the draw queue gives one 64-byte element per visible batch and ribbon and one for its custom draw, each on the emitter queue one per particle emitter. A batch's alpha is the instance alpha, times its colour's animated alpha when its colour index is in range, times its transparency weight when it has textures; alpha ≤ 0 skips it, a NaN does not. A batch, ribbon or emitter of blend 0 or 1 and alpha at least 0.99999 goes to list 0, as does an opaque custom draw; otherwise a batch goes to list 1 above the clip plane, list 2 below, possibly both; the rest to list 1 if above, else 2.

kindelement
0a batch
1a batch with flag 4, when the scene has a special callback; translucent, list 1, or list 2 under a plane
2an opaque batch of a batchable instance, flag 0x10, cache bit 0x20, no lights: the grouped list
3a ribbon emitter whose visible byte is set, alpha the instance's times its animated alpha
4a particle emitter that still draws, of an instance with alpha above 0
5the instance's custom draw, alpha 1.0

The derivation is in the doc.

Fields 1

offsetsizetypenamemeaningconfidencefinding
0x002c4M2TextureUnit *m_unitHolds the batch's texture unit: a record of the selected view, or of the instance's own batch tableverified, proof twomodels/records#texture-unit-layer