Viewer: vehicle lamps (head, tail, brake, reversing, indicators) #61

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

@⁠holdmysocks on GitHub · 2026-11-23 17:49 UTC · original
holdmysocks:claude/vehicle-lamps → master · +142 −3 · 4 files · 1 commits · merged 2026-11-23 18:05 UTC

Switches in the viewer's Rig section for a vehicle's lamps.

How a lamp is built

A lamp is up to three meshes on bones of its own:

  • a reflector (standard_vehicle_2lyr_reflector) on the lamp bone: headlight_l, taillight_m, brakelight_l, reversinglight_l, indicator_lf, drlight_lf, platelight, interiorlight ...
  • a lens (standard_vehicle_alpha) on the bone <lamp>_glass
  • on some lamps an LED mesh (standard_vehicle_emissive_animated_bones) skinned to the lamp bones

Changes

  • Rig panel: head, high beam, daytime, tail (with the number plate lamp), brake, reversing, indicator left / right, hazards, interior. Indicators blink at 1.5 Hz.
  • A lit lamp's light rides in the bottom row of its bone's joint matrix, which is otherwise (0, 0, 0, 1). The vertex shader takes it out before using the matrix.
  • Reflectors and lenses on a lit bone glow in a fixed colour for the lamp's kind. An LED mesh shows its own colour map while its bone is lit and is dark otherwise; it was always lit before.
  • --lights head,high,day,tail,brake,reverse,left,right,hazard,interior for automation.

Checked

  • comet7: headlights, daytime strips, the rear light bar with brake and reversing sections, front indicators.
  • buffalo6: tail lamp ring, reversing lamps, high-mount brake lamp.
  • bison4 and the sanchez dirt bike: headlights.
  • Build of both binaries; 137 core tests pass (no core change).

Not decoded

  • How the game switches lamps. The shader's name says by bone animation; no clip or scale was read.
  • Lamp brightness and colours (fixed here: warm white, red, amber) and the light a lamp casts.
  • Sirens and extra lamps have no switch.
  • Not on the Metal renderer.
  • Horn: every vehicle has a game-object audio record under its model name hash (class 9, 108 bytes, about 17 references to other objects by index). Which one is the horn is not decoded, so no horn is played.
**@⁠holdmysocks** on GitHub · 2026-11-23 17:49 UTC · [original](https://github.com/holdmysocks/SixNG/pull/61) `holdmysocks:claude/vehicle-lamps` → `master` · +142 −3 · 4 files · 1 commits · merged 2026-11-23 18:05 UTC Switches in the viewer's Rig section for a vehicle's lamps. ## How a lamp is built A lamp is up to three meshes on bones of its own: - a reflector (`standard_vehicle_2lyr_reflector`) on the lamp bone: `headlight_l`, `taillight_m`, `brakelight_l`, `reversinglight_l`, `indicator_lf`, `drlight_lf`, `platelight`, `interiorlight` ... - a lens (`standard_vehicle_alpha`) on the bone `<lamp>_glass` - on some lamps an LED mesh (`standard_vehicle_emissive_animated_bones`) skinned to the lamp bones ## Changes - Rig panel: head, high beam, daytime, tail (with the number plate lamp), brake, reversing, indicator left / right, hazards, interior. Indicators blink at 1.5 Hz. - A lit lamp's light rides in the bottom row of its bone's joint matrix, which is otherwise (0, 0, 0, 1). The vertex shader takes it out before using the matrix. - Reflectors and lenses on a lit bone glow in a fixed colour for the lamp's kind. An LED mesh shows its own colour map while its bone is lit and is dark otherwise; it was always lit before. - `--lights head,high,day,tail,brake,reverse,left,right,hazard,interior` for automation. ## Checked - comet7: headlights, daytime strips, the rear light bar with brake and reversing sections, front indicators. - buffalo6: tail lamp ring, reversing lamps, high-mount brake lamp. - bison4 and the sanchez dirt bike: headlights. - Build of both binaries; 137 core tests pass (no core change). ## Not decoded - How the game switches lamps. The shader's name says by bone animation; no clip or scale was read. - Lamp brightness and colours (fixed here: warm white, red, amber) and the light a lamp casts. - Sirens and extra lamps have no switch. - Not on the Metal renderer. - Horn: every vehicle has a game-object audio record under its model name hash (class 9, 108 bytes, about 17 references to other objects by index). Which one is the horn is not decoded, so no horn is played.
A vehicle lamp is up to three meshes on bones of its own: a reflector
(standard_vehicle_2lyr_reflector) on the lamp bone (headlight_l,
taillight_m, brakelight_l, reversinglight_l, indicator_lf, drlight_lf,
platelight, interiorlight ...), a lens (standard_vehicle_alpha) on the
bone <lamp>_glass, and on some lamps an LED mesh
(standard_vehicle_emissive_animated_bones) skinned to the lamp bones.

- Rig panel: checkboxes for head, high beam, daytime, tail (with the
  number plate lamp), brake, reversing, left and right indicators,
  hazards and interior. Indicators blink at 1.5 Hz.
- A lit lamp's light (colour x intensity) rides in the bottom row of its
  bone's joint matrix, which is otherwise (0, 0, 0, 1); the vertex
  shader takes it out before using the matrix. Reflectors and lenses on
  a lit bone glow in a fixed colour for the lamp's kind; an LED mesh
  shows its own colour map while its bone is lit and is dark otherwise
  (it was always lit before).
- --lights head,high,day,tail,brake,reverse,left,right,hazard,interior
  for automation.

Checked on comet7 (headlights, daytime strips, the rear light bar with
brake and reversing sections, front indicators), buffalo6 (tail lamp
ring, reversing lamps, high-mount brake lamp) and bison4 (headlights).

Not decoded: how the game switches lamps (the shader's name says by
bone animation; no clip or scale was read), lamp brightness and
colours (fixed here: warm white, red, amber), the light a lamp casts.
Not on the Metal renderer. Sirens and extra lamps (siren*, extralight*)
have no switch. Horn: every vehicle has a game-object audio record
under its model name hash (class 9, 108 bytes, about 17 references to
other objects by index); which of them is the horn is not decoded, so
no horn is played.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:06:42 +00:00
github manually merged commit 9a23bb840b into gh-pr/61/base 2026-11-26 20:06:43 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.