benilla-re systems structs docs

M2ElementCompareTransparent

function · models · primitive

Address
0x70ae10 · 467 bytes, up to 0x70afe2
Meaning
Orders transparent elements by priority, depth, sort keys, instance, kind and unit layer, then the opaque order
Confidence
verified, proof one
Finding
models/scene#element-sort-orders

Finding: Element sort orders in models: the scene

Each order compares two elements key by key, returning at the first difference. Unsigned unless marked; mode is the scene's copy +0x148 of the cache mode.

orderkeys
transparentunder mode bit 4, the priority of the kind in 0x873184; depth +0x14 descending; +0x8 descending (signed); +0x28 ascending (signed); under mode bit 2, +0x38 ascending; depth +0x18 descending; instance +0x4 ascending; kind (signed); for kinds 0 to 2, the layer +0xc of the unit +0x2c ascending (records#texture-unit-layer); then the opaque order
opaque, all kindskind (signed)
opaque, kind 0under mode bit 1, vertex shader +0x38; the shared header; +0x34 (signed); instance +0x4; the submesh's +0xe; vertex shader +0x38; pixel shader +0x3c
opaque, kinds 0 and 1material flags word; blend word; each of the first min(nA, nB) textures by handle; texture count +0xe; each of the first min(nA, nB) texture unit entries; the unit pointer +0x2c ascending: file order within one view, or the order of the instance's own table +0x3ec, which keeps its units in file order; kind 1 has no model or instance key, so between instances it is address order
opaque, kind 3each of the first min ribbon textures by handle; the ribbon's texture count; the ribbon index +0x1c
opaque, kind 4the emitter index +0x1c

The derivation is in the doc.

Callers 0

None by a direct call or jump.

Callees 1

Calls and jumps by a bare address, from tables/calls.tsv.