Vehicle colours: each configuration's wear levels (ladder entry per part id) #291

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

@⁠holdmysocks on GitHub · 2026-11-25 15:50 UTC · original
holdmysocks:wear-levels → master · +127 −8 · 2 files · 1 commits · merged 2026-11-25 16:31 UTC

What

  • Decodes which of a wear ladder's six entries a vehicle uses. The configuration parts in the slots wear, wear_interior, wear_engine, wear_wheels and six unnamed ones carry level modifiers (08b2439a). Each names a wear channel, a level 0 to 5 and a primer set mask. Bindings with the wear flag (75939b79, joaat "wear") give each part id its wear channel.
  • New Tables::wear_levels (vehicle_parts.json FORMAT 23): model → configuration key → each part id's level and primer mask (256 x 4 hex digits, ffff = none).
  • model.json part_colours.wear_records gets levels_by_config and levels_default (the levels most configurations give). The level indexes the ladder's materialPresets and wearPresets. EXPORT_VERSION 28. The note in model.json says so.
  • Nothing is applied to the GLB or the viewer yet.

Checked

  • New unit test wear_levels_follow_the_wear_bindings; workspace tests pass.
  • Library survey: 3,912 of 4,063 configurations carry wear-level parts. Each slot's parts step one channel set through levels 0 to 5. Primer mask: 1 at levels 0 to 2 of the body, 7 at 3 to 5.
  • Real export, in a private work folder (the shared index was not touched):
    • zorrusso: 11 configurations, all with levels; the usual one is level 0 on 240 part ids.
    • rancher: 36 configurations; the usual one is level 3; across configurations it ranges from 1 to 5.
    • Each level leads to a preset record in presets.

Not decoded / not done

  • A per-vehicle dirt level is not in the data. The other modifier in these slots (2ae7eec3, rainHash) is only on trucks with beds or boxes (biff, rubble, tiptruck, mule, towtruck, benson, iota, mb210). Its six values name no library record. Dirt is most likely set at run time.
  • What the shader does with the presets is being read separately; it is not part of this PR.
  • Builds of vehicle_parts.json at FORMAT 22 are rebuilt on first use, so this needs the same coordination with BeamNG as the format 22 change.
**@⁠holdmysocks** on GitHub · 2026-11-25 15:50 UTC · [original](https://github.com/holdmysocks/SixNG/pull/291) `holdmysocks:wear-levels` → `master` · +127 −8 · 2 files · 1 commits · merged 2026-11-25 16:31 UTC ## What - Decodes which of a wear ladder's six entries a vehicle uses. The configuration parts in the slots `wear`, `wear_interior`, `wear_engine`, `wear_wheels` and six unnamed ones carry level modifiers (`08b2439a`). Each names a wear channel, a level 0 to 5 and a primer set mask. Bindings with the `wear` flag (`75939b79`, joaat "wear") give each part id its wear channel. - New `Tables::wear_levels` (vehicle_parts.json FORMAT 23): model → configuration key → each part id's level and primer mask (256 x 4 hex digits, `ffff` = none). - model.json `part_colours.wear_records` gets `levels_by_config` and `levels_default` (the levels most configurations give). The level indexes the ladder's `materialPresets` and `wearPresets`. EXPORT_VERSION 28. The note in model.json says so. - Nothing is applied to the GLB or the viewer yet. ## Checked - New unit test `wear_levels_follow_the_wear_bindings`; workspace tests pass. - Library survey: 3,912 of 4,063 configurations carry wear-level parts. Each slot's parts step one channel set through levels 0 to 5. Primer mask: 1 at levels 0 to 2 of the body, 7 at 3 to 5. - Real export, in a private work folder (the shared index was not touched): - zorrusso: 11 configurations, all with levels; the usual one is level 0 on 240 part ids. - rancher: 36 configurations; the usual one is level 3; across configurations it ranges from 1 to 5. - Each level leads to a preset record in `presets`. ## Not decoded / not done - A per-vehicle dirt level is not in the data. The other modifier in these slots (`2ae7eec3`, `rainHash`) is only on trucks with beds or boxes (biff, rubble, tiptruck, mule, towtruck, benson, iota, mb210). Its six values name no library record. Dirt is most likely set at run time. - What the shader does with the presets is being read separately; it is not part of this PR. - Builds of `vehicle_parts.json` at FORMAT 22 are rebuilt on first use, so this needs the same coordination with BeamNG as the format 22 change.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:25:01 +00:00
github manually merged commit be4dec2528 into gh-pr/291/base 2026-11-26 20:25:02 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.