Viewer: draw the game's own vehicle liveries #423
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!423
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-423"
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 23:23 UTC · original
holdmysocks:game-liveries→master· +297 −21 · 9 files · 2 commits · merged 2026-11-27 02:12 UTCThe viewer can now put on the game's own vehicle liveries ("brands", such as the dairy livery of the Benson box truck). Each sticker is placed with the transform the game computes from its livery layout.
What the game does (read from the packer and the paint shader)
Livery layer record (64 bytes, written by the packer at rva 0x37766a0):
Transform. The shader draws the sticker where
u = a·U + b·V + ouandv = c·U + d·V + ovboth lie in 0..1. The packer builds it in three steps:lerp(scale_lo, 1, r).The rotation also moves by
turn·(2r' − 1)degrees. Hererandr'are per-vehicle random draws; the viewer uses 0.5 for both. The size's first field (9d2ff2b1) is U's size; the earlier export had the two the other way round.UV set. UV mode k (1..4) reads the mesh's UV set k − 1 (shader 00d78–00dcc). Across all brands:
So most stickers use the third UV set.
Zones. A layout names sticker zones only. On a vehicle built from parts, those zones can lie on a fitted part (the Benson's box is
truckbeds_box_01_hi) rather than on the body.Changes
vehstickers):uv(the game transform), plusscale_lo,turnandmask.liveries()returns the brands per vehicle.--livery-brand NAMEfor scripted renders.Tests
vehstickerstests pass (2), including a new one for the transform.livery,glband shader validation tests pass (12).BENSON_BRAND_BAUMHARDERDAIRY.Not done
Some brands name zones that no vertex of the vehicle or its parts carries, so they draw nothing:
A remap may exist; it is not traced.
The random scale and turn are taken at their middle values.
The brand's fourth colour (
other_colour) is not used. It may be the paint under the livery.The Metal renderer does not pass the new UV sets, so game stickers in sets 2 and 3 do not show there.