Viewer: occlusion from the vehicle material map #101

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

@⁠holdmysocks on GitHub · 2026-11-24 02:21 UTC · original
holdmysocks:claude/vehicle-occlusion → master · +34 −3 · 6 files · 1 commits · merged 2026-11-24 02:31 UTC

What

The blue channel of a vehicle layer's material map (lyr0materialatex, slot 2bb2ede8) is an occlusion factor: the paint shader multiplies both its diffuse-side and its specular-side colour by it just before the outputs (read from the shader's code by the shader session; write-up section 17).

The viewer now binds that map in the packed slot of vehicle materials and uses only its blue channel: on ambient light and reflections like any other occlusion, and on the direct light as well. Red and green (the metalness and roughness blend) stay as the export applies them, one value per model.

Checked

  • comet7, sultan and bison rendered with doors, bonnet and boot open, before and after: 2.3 to 3.2 % of pixels change by more than 6/255, mean brightness drops by about 0.5/255. Engine bays, bumper undersides and wheel arches are slightly darker in the creases; painted panels are unchanged.
  • cargo test -p sixng-gui: 12 passed (no new tests).

Not done

  • Not on the Metal renderer: it reads a packed map as roughness / metalness, so the map is not bound there.
  • Overlay layers blend the occlusion towards their own value first in the game; that is not done.
  • Layer 1's material and colour (the wear layer) are still unused.
**@⁠holdmysocks** on GitHub · 2026-11-24 02:21 UTC · [original](https://github.com/holdmysocks/SixNG/pull/101) `holdmysocks:claude/vehicle-occlusion` → `master` · +34 −3 · 6 files · 1 commits · merged 2026-11-24 02:31 UTC ## What The blue channel of a vehicle layer's material map (`lyr0materialatex`, slot `2bb2ede8`) is an occlusion factor: the paint shader multiplies both its diffuse-side and its specular-side colour by it just before the outputs (read from the shader's code by the shader session; write-up section 17). The viewer now binds that map in the packed slot of vehicle materials and uses only its blue channel: on ambient light and reflections like any other occlusion, and on the direct light as well. Red and green (the metalness and roughness blend) stay as the export applies them, one value per model. ## Checked - comet7, sultan and bison rendered with doors, bonnet and boot open, before and after: 2.3 to 3.2 % of pixels change by more than 6/255, mean brightness drops by about 0.5/255. Engine bays, bumper undersides and wheel arches are slightly darker in the creases; painted panels are unchanged. - `cargo test -p sixng-gui`: 12 passed (no new tests). ## Not done - Not on the Metal renderer: it reads a packed map as roughness / metalness, so the map is not bound there. - Overlay layers blend the occlusion towards their own value first in the game; that is not done. - Layer 1's material and colour (the wear layer) are still unused.
The blue channel of a vehicle layer's material map (lyr0materialatex,
slot 2bb2ede8) is an occlusion factor on the diffuse and the specular
side (read from the paint shader's code). The viewer binds that map in
the packed slot of vehicle materials and uses only its blue: on ambient
and reflections like other occlusion, and on the direct light as well.
Not on the Metal renderer.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:09:54 +00:00
github manually merged commit 154ed58fa2 into gh-pr/101/base 2026-11-26 20:09:56 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.