Materials: decode the layered-material libraries (clothing and weapon colours) #107
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!107
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/107/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-24 02:49 UTC · original
holdmysocks:claude/material-library→master· +379 −5 · 6 files · 1 commits · merged 2026-11-24 02:56 UTCWhat this adds
sixng-core::matlib: decoder for the layered-material libraries, the two PSO files of data.rpf with root struct8419ab01. It reads the base-material map (42fa4d39->6cc4c278) and the layered-preset map (fd540657->756aef9c): per record the float, texture, colour and int parameter lists (name hash, index, sub-material, value) and a preset's 8 base-material names.sixng materials [data] [--preset <hex>]... [-o <dir>]: builds<work>/index/material_presets.json(per preset the four entries of colour parameterf574261bfor each of the 8 sub-materials, plus weapon component and variant name hash -> preset from the weapon family files of packs.rpf).--presetprints a preset in full with its base materials and the three gradient stops per colour;-owrites the whole libraries as JSON.ped-variations: each item getspreset(itsGarmentPreset, first along the parent chain), and each variationpreset_colours(per drawable: preset and the 8 sub-material base colours) when the index exists.matlib::stops: the three linear-RGB gradient stops the game derives from one colour (0.1 x value; the colour; saturation x 0.55 at value x 0.55 + 0.45).What was checked
cargo test -p sixng-core: 148 passed. Three new unit tests (preset to base fallback and index, stops, weapon links).What is not decoded or not done
Tint0..2do when it has a preset.951cf6e3,2d71e4f7).d2b598e5[0..4]) is the fabric greyscale.wardrobe::item_chainstill also followse13ebaf8as a possible parent id, as before; left unchanged.