Viewer: each part's wear from the vehicle's configuration #292

Manually merged
github merged 2 commits from gh-pr/292/head into gh-pr/292/base 2026-11-26 20:25:08 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-25 16:08 UTC · original
holdmysocks:viewer-wear → master · +237 −17 · 6 files · 2 commits · merged 2026-11-25 16:34 UTC

Builds on #291 (needs its levels_by_config export); merge after it.

What

  • New viewer option, on by default when a model has wear levels: wear from the configuration. Each part id's wear amount comes from the shown configuration (the model's usual one when none is picked):
    • its wear level picks its ladder's wear preset;
    • the preset's age range gives the amount: the middle of minWear and maxWear;
    • a preset whose age is not a range takes the average of its level (15, 150, 197, 211, 239, 239 out of 255, from the library's ranges).
  • The amount goes in column 11 of the part's coat row in the part ramp image. The shader uses it in place of the wear slider (jitter.w < 0 selects this mode).
  • Turning the option off brings back the manual slider. --wear N on the command line also switches to the manual amount.
  • The part ramp image is rebuilt when the configuration changes, not only when the look changes.

Checked

  • New unit test part_wear_from_the_configuration; workspace tests pass.
  • Renders, in a private work folder:
    • rancher (usually level 3): configuration wear changes 1.7% of the picture against no wear. Rust shows on the bed floor and the spare wheel. A manual full wear (--wear 1) changes the same areas (1.75%).
    • zorrusso (level 0): 0.39%, nearly clean.

Not decoded / not done

  • Where on a part the wear shows is still the old guess: the blue channel of the part's detail texture. The game uses its own tiled wear mask texture and vertex colours, which the viewer does not read. So painted body panels show no wear in either mode.
  • The game probably picks a random amount between minWear and maxWear; the middle is a stand-in.
  • Dirt is not shown: its amount is set at run time, not in the files.
**@⁠holdmysocks** on GitHub · 2026-11-25 16:08 UTC · [original](https://github.com/holdmysocks/SixNG/pull/292) `holdmysocks:viewer-wear` → `master` · +237 −17 · 6 files · 2 commits · merged 2026-11-25 16:34 UTC Builds on #291 (needs its `levels_by_config` export); merge after it. ## What - New viewer option, on by default when a model has wear levels: **wear from the configuration**. Each part id's wear amount comes from the shown configuration (the model's usual one when none is picked): - its wear level picks its ladder's wear preset; - the preset's age range gives the amount: the middle of `minWear` and `maxWear`; - a preset whose age is not a range takes the average of its level (15, 150, 197, 211, 239, 239 out of 255, from the library's ranges). - The amount goes in column 11 of the part's coat row in the part ramp image. The shader uses it in place of the wear slider (`jitter.w < 0` selects this mode). - Turning the option off brings back the manual slider. `--wear N` on the command line also switches to the manual amount. - The part ramp image is rebuilt when the configuration changes, not only when the look changes. ## Checked - New unit test `part_wear_from_the_configuration`; workspace tests pass. - Renders, in a private work folder: - rancher (usually level 3): configuration wear changes 1.7% of the picture against no wear. Rust shows on the bed floor and the spare wheel. A manual full wear (`--wear 1`) changes the same areas (1.75%). - zorrusso (level 0): 0.39%, nearly clean. ## Not decoded / not done - Where on a part the wear shows is still the old guess: the blue channel of the part's detail texture. The game uses its own tiled wear mask texture and vertex colours, which the viewer does not read. So painted body panels show no wear in either mode. - The game probably picks a random amount between `minWear` and `maxWear`; the middle is a stand-in. - Dirt is not shown: its amount is set at run time, not in the files.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:25:05 +00:00
github manually merged commit 611a56edd1 into gh-pr/292/base 2026-11-26 20:25:06 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.