Weapons: metalness and roughness per sub-material #129
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!129
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/129/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 06:09 UTC · original
holdmysocks:claude/weapon-surface→master· +70 −11 · 5 files · 1 commits · merged 2026-11-24 06:14 UTCWhat this changes
matlib::Library::surface(preset, sub)reads two library parameters whose names are not recovered:0e555ef5as metalness and83472381as roughness (the preset's value for the sub-material, else its base material's; without one, metalness falls back to the tile'stilemetallic, else 0, and roughness to 0.5). The index (version 5) stores them per preset (surfaces).weapon_presetin the material extras listssub_material_surface. The material's own factors stay the stand-in.weaponmaterials set the per-vertex surface bit, so the code is used; the assembled-weapon path writes the same code, also for a chosen finish. Cached weapon exports are refreshed once.Why these two parameters
Read from the data, not from the shader. Over the 21,051 sub-materials of the weapon library, grouped by base colour:
0e555ef5present / median83472381medianRoughness separates the groups clearly. Metalness is mostly a matter of presence, which is why a missing value falls back to the tile and then to 0.
What was checked
--gpu radeon) of the pistol before and after, and with the gold finish: the grip turns matte and non-metallic, frame and slide stay metallic, gold reads as metal.cargo test -p sixng-core: 151 passed (the matlib test covers the fallback chain). Release builds of CLI and viewer pass.What is not done / not known