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.
| kind | element |
|---|---|
| 0 | a batch |
| 1 | a batch with flag 4, when the scene has a special callback; translucent, list 1, or list 2 under a plane |
| 2 | an opaque batch of a batchable instance, flag 0x10, cache bit 0x20, no lights: the grouped list |
| 3 | a ribbon emitter whose visible byte is set, alpha the instance's times its animated alpha |
| 4 | a particle emitter that still draws, of an instance with alpha above 0 |
| 5 | the instance's custom draw, alpha 1.0 |
The derivation is in the doc.
Fields 1
| offset | size | type | name | meaning | confidence | finding |
|---|---|---|---|---|---|---|
0x002c | 4 | M2TextureUnit * | m_unit | Holds the batch's texture unit: a record of the selected view, or of the instance's own batch table | verified, proof two | models/records#texture-unit-layer |