Batches: name the layer-blend byte of prop instances #382
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/holdmysocks--SixNG!382
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/382/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@holdmysocks on GitHub · 2026-11-26 17:16 UTC · original
holdmysocks:blend-b-instance→master· +34 −7 · 4 files · 3 commits · merged 2026-11-26 18:34 UTCThe per-instance value b in the two-layer blend (`m = b if b + instance_switch < 1, else min(blendintensity, 3 b)`) was assumed to be 1. This PR traces where it comes from.
Batch props (prop_2lyr_batch drawn instanced): the mesh program reads the 64-byte batch instance record as it is. It loads the 3x4 matrix at +0x00, the tint at +0x34 and the dword at +0x3C. It passes byte +0x3E / 255 as b and byte +0x3F / 255 next to it. The pixel program feeds +0x3F into a desaturation of the blended colour.
Other placements: b is byte 3 of the first dword of the draw's 32-byte per-instance record. The code that fills it from the placement was not read. Two u8 entity fields that default to 255 (0dc5f270, 540ca436) are candidates, but they differ from each other on most entities.
Changes:
Export: the batch export also writes
batch_props_layer.bin, 2 bytes per prop instance inbatch_props.binorder (layer_blend, layer_aux). It is a separate file so the 44-byte records and their readers stay as they are. Checked on a regional export: 1,102,571 records in both files.