Export: the second vertex colour stream, which holds a vehicle's sticker zones #162

Manually merged
github merged 2 commits from gh-pr/162/head into gh-pr/162/base 2026-11-26 20:14:31 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-24 14:26 UTC · original
holdmysocks:claude/liveries-zones → master · +25 −12 · 9 files · 2 commits · merged 2026-11-24 15:37 UTC

What

The mesh decoder read one colour stream (slot 1). Meshes also carry a second RGBA8 stream in slot 12, which was dropped. The export now keeps it and writes it to the GLB as the custom attribute _COLOR1.

Why it matters: on vehicle bodies the fourth byte of that stream is the sticker zone of the vertex, the number a livery's layout records list to say which panels a sticker goes on. This is the first step of drawing liveries (SIX-109); nothing is drawn yet.

Checked

  • truckbeds_box_01_hi and benson_hi exported with the stream. The fourth byte takes few distinct values (40 on the box body, 87 on the cab).
  • The zones match the layouts of the benson's brands. On the box: 169 to 174 are the left side wall in six panels, 177 to 182 the right side wall, 165 to 168 the front wall in four. On the cab: 24 lies on the left door and 32 on the right door. These are exactly the index lists of a brand's layouts (two large side stickers, front wall stickers, two door stickers).
  • Independent source: the pixel program of the two-layer vehicle shader takes a per-vertex value whose low byte is the part id and whose next byte indexes a per-vehicle zone table of sticker records (read by the shader session).
  • cargo build -p sixng-cli -p sixng-gui passes; the core tests compile and pass.

Not decoded / not done

  • The other three bytes of the stream are not understood.
  • How a layout's position and size map into a zone's UV space is not pinned down. Fitting 225 layouts gives roughly: sticker centre = an offset per panel group minus half the layout position, in the second UV set, with the size acting as a scale (a larger number is a smaller sticker). The per-panel offset is not derived from data yet.
  • GLBs of models that have the stream grow by 4 bytes per vertex. Existing exports are not invalidated; the viewer ignores the attribute.
**@⁠holdmysocks** on GitHub · 2026-11-24 14:26 UTC · [original](https://github.com/holdmysocks/SixNG/pull/162) `holdmysocks:claude/liveries-zones` → `master` · +25 −12 · 9 files · 2 commits · merged 2026-11-24 15:37 UTC ## What The mesh decoder read one colour stream (slot 1). Meshes also carry a second RGBA8 stream in slot 12, which was dropped. The export now keeps it and writes it to the GLB as the custom attribute `_COLOR1`. Why it matters: on vehicle bodies the fourth byte of that stream is the **sticker zone** of the vertex, the number a livery's layout records list to say which panels a sticker goes on. This is the first step of drawing liveries (SIX-109); nothing is drawn yet. ## Checked - `truckbeds_box_01_hi` and `benson_hi` exported with the stream. The fourth byte takes few distinct values (40 on the box body, 87 on the cab). - The zones match the layouts of the benson's brands. On the box: 169 to 174 are the left side wall in six panels, 177 to 182 the right side wall, 165 to 168 the front wall in four. On the cab: 24 lies on the left door and 32 on the right door. These are exactly the index lists of a brand's layouts (two large side stickers, front wall stickers, two door stickers). - Independent source: the pixel program of the two-layer vehicle shader takes a per-vertex value whose low byte is the part id and whose next byte indexes a per-vehicle zone table of sticker records (read by the shader session). - `cargo build -p sixng-cli -p sixng-gui` passes; the core tests compile and pass. ## Not decoded / not done - The other three bytes of the stream are not understood. - How a layout's position and size map into a zone's UV space is not pinned down. Fitting 225 layouts gives roughly: sticker centre = an offset per panel group minus half the layout position, in the second UV set, with the size acting as a scale (a larger number is a smaller sticker). The per-panel offset is not derived from data yet. - GLBs of models that have the stream grow by 4 bytes per vertex. Existing exports are not invalidated; the viewer ignores the attribute.
Mesh stream 12 (RGBA8) was dropped. It is now decoded and written to the GLB as _COLOR1. On vehicle bodies its fourth byte is the sticker zone a livery's layout records list (box side walls, front wall, cab doors).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:14:29 +00:00
github manually merged commit e889c5a2f2 into gh-pr/162/base 2026-11-26 20:14:31 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.