Viewer: the primer's colour from the material palette #350
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!350
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/350/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 04:01 UTC · original
holdmysocks:primer-colour→master· +187 −17 · 6 files · 2 commits · merged 2026-11-26 04:26 UTCViewer: the primer layer takes its colour from the material palette, as the game does, instead of a stand-in grey.
What the game does (read from its code; addresses in the code comments)
f1379639) carries six primer palette entries: two primer types × three primer sets, each a row and a slice. Type 0 set 0 is the row and slice the viewer already reads for the part's own colour.primerType(78b545dd, u8 at +0x3c): 563 surfaces have 0, 194 have 1.primerSetsmask allows (the masks in use are 1, 2 and 7).win(summed primer mask, primerGradientStart, primerGradientEnd - primerGradientStart), with no tint.Changes
part_colours.primer(format 24 / export version 29), per look and per part id the primer rows for sets 0 to 2 (12 hex digits). Vehicles are exported again when the viewer opens them.--primer-set. These pick the set for parts whose mask allows several, standing in for the game's random choice.Not covered
primerPalette(the game takes them from the primer surface record).primerPaletterow (tintRow0) is used for.