Export: weapon parts in their preset colours #119

Manually merged
github merged 1 commit from gh-pr/119/head into gh-pr/119/base 2026-11-26 20:11:14 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-24 04:45 UTC · original
holdmysocks:claude/weapon-export-colours → master · +60 −3 · 4 files · 1 commits · merged 2026-11-24 04:52 UTC

What this changes

  • Weapon models are exported in colour. A model with weapon materials looks up its layered-material preset by name (weapon library, matlib) and writes COLOR_0 per vertex: the preset's base colour of the vertex's sub-material (green byte of the raw colour stream / 4), linear. The material's stand-in becomes weapon_parts (white base colour factor; metallic and roughness as before), and the material extras get weapon_preset (preset, the eight sub-material colours, what is applied; preset: null when the library names none, and the old gun-metal stand-in stays).
  • Viewer. Because the colours are in the export, a weapon part opened on its own is coloured, as is any glTF export of a weapon. Cached weapon exports from before are re-exported once (cache rule on weapon_preset). The assembled-weapon path of #114 is unchanged and gives the same colours.
  • README: one sentence in the materials row.

What was checked

  • Exported two pistol parts: the grip has one colour on all vertices, the slide five (its preset's sub-materials); base factor white, weapon_parts, extras present.
  • Viewer screenshots (--gpu radeon): the slide alone is coloured; the assembled pistol looks as it did after #114.
  • cargo test -p sixng-core: 148 passed; cargo check and release builds of CLI and viewer pass.

What is not done / not known

  • Base colour only: no tile texture, gradient or layers; one metallic / roughness stand-in for every part, so wood and polymer are as shiny as steel.
  • The sub-material byte rule is inferred from data (60 of 62 parts checked follow it), not read from the vertex shader.
  • A model with two presets takes the first; variant presets (finishes) are not selectable.
  • 31 of 894 weapon models with a preset are not matched to a drawable name and stay gun-metal.
**@⁠holdmysocks** on GitHub · 2026-11-24 04:45 UTC · [original](https://github.com/holdmysocks/SixNG/pull/119) `holdmysocks:claude/weapon-export-colours` → `master` · +60 −3 · 4 files · 1 commits · merged 2026-11-24 04:52 UTC ## What this changes - **Weapon models are exported in colour.** A model with `weapon` materials looks up its layered-material preset by name (weapon library, `matlib`) and writes COLOR_0 per vertex: the preset's base colour of the vertex's sub-material (green byte of the raw colour stream / 4), linear. The material's stand-in becomes `weapon_parts` (white base colour factor; metallic and roughness as before), and the material extras get `weapon_preset` (preset, the eight sub-material colours, what is applied; `preset: null` when the library names none, and the old gun-metal stand-in stays). - **Viewer.** Because the colours are in the export, a weapon part opened on its own is coloured, as is any glTF export of a weapon. Cached weapon exports from before are re-exported once (cache rule on `weapon_preset`). The assembled-weapon path of #114 is unchanged and gives the same colours. - README: one sentence in the materials row. ## What was checked - Exported two pistol parts: the grip has one colour on all vertices, the slide five (its preset's sub-materials); base factor white, `weapon_parts`, extras present. - Viewer screenshots (`--gpu radeon`): the slide alone is coloured; the assembled pistol looks as it did after #114. - `cargo test -p sixng-core`: 148 passed; `cargo check` and release builds of CLI and viewer pass. ## What is not done / not known - Base colour only: no tile texture, gradient or layers; one metallic / roughness stand-in for every part, so wood and polymer are as shiny as steel. - The sub-material byte rule is inferred from data (60 of 62 parts checked follow it), not read from the vertex shader. - A model with two presets takes the first; variant presets (finishes) are not selectable. - 31 of 894 weapon models with a preset are not matched to a drawable name and stay gun-metal.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:11:12 +00:00
github manually merged commit f465d73dfd into gh-pr/119/base 2026-11-26 20:11:14 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.