Viewer: the game's dust and scratch mask on vehicle paint #410
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!410
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-410"
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 20:50 UTC · original
holdmysocks:wear-dust→master· +137 −2 · 7 files · 9 commits · merged 2026-11-26 22:01 UTCThe viewer now draws the roughness and clear-coat effects of the game's dust and scratch mask on vehicle paint. Builds on PR 405, which builds on PR 401; merge those first.
What the game does (shader block 04f08–05260 and the packer, read from the code)
dusttexture(parameterfb03ae36, shader texture 21 = material slot 22). Its red and blue are sparse scratch masks; its green is mostly high (dust).sat(I[0x30] × (1 − I[0x2c] × (1 − tex))).k1 = sat(bit18·r + bit21·b + bit0·dust) × 10 × +60 b0/255, thencoat = sat(coat − k1 × Wbase × +56 b0/255). The selector of the dust term is bit 0 (wear on), not bit 24, as the lift shows (mask constant 1 at 05018).k3 = sat(bit20·r + bit23·b + bit26·dust), thenrough = sat(rough + k3 × (+56 b0 × Wbase + b1 × W3 + b2 × W1)/255).Changes
dusttextureis bound as material binding 8. Flag bit 4 says it is present; without it the wear mask is bound in its place.part_wearpacks the 16 bytes the shader reads, with the game's curve and byte arithmetic, into coat-row columns 73 to 88.Tests
part_wear,primerandshaders_validatepass (3). A new case checks the 16 bytes: tiling 6.5 × 5.1 → 33; red scratch curve 0.4 → 102 and signed 178; base gain 255; flag bits 18 and 26.Approximations and not done