Tattoo bake: the 0x40 vertex-colour region cap #544
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!544
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-544"
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-28 05:39 UTC · original
holdmysocks:claude/tattoo-region-vertex-385→master· +106 −46 · 2 files · 3 commits · merged 2026-11-28 05:51 UTCPart of #385: the vertex-colour region cap for decorations (flag 0x40). Follows #539.
A decoration record with a layer flagged 0x40, and none flagged 0x2, scales every layer by one vertex-colour channel. I traced which channel a layer reads through the game's exe:
MSNC_VS_BakeDecorations). It scans every layer of the record:_COLOR0rgba, 4-7 are_COLOR1rgba, 8 and up are 1.So the channel is the layer's own mode, and the rule is decided per record.
What changes:
peddeco::Region(Mask/Vertex) andRegion::ofreplace the mask-only check. The mask wins when a record has both flags.Cornercarries both colour streams. A part without a stream reads 255 there, so it gets no cap.region_captakes the region and the layer's mode. The export builds one cap per (region, mode) it needs.Result. The guardia's teal torso piece (outfits 17 and 37) is in a 0x40 record as a mode-2 layer. Mode 2 reads
_COLOR0.b, which is 16 on every vertex of the male skin meshes. So the game draws it at about 6% (16/255), and the bake now matches. Before and after on outfit 17: only the teal piece changes (253 texels, all inside it); the outfit's other baked texture is byte-identical.Reach: 27 of the 7,509 records have 0x40 without 0x2. The other two layers in the guardia record are mode 4 (
_COLOR1.r, 255 on the skin), so they are unchanged.Caveat: this uses the vertex colours stored in the mesh files. I found no code that rewrites them at runtime, but I can't rule it out.
Tests: