# 240SX shared car textures and remaining runtime paint gap (r295)

The player-car exporter previously decoded each car's local `TEXTURES.BIN` only. It now also decodes shared TPK records in the installed game's `GLOBALB.BUN`; local car records keep precedence for duplicate texture keys. This recovers shared maps with recorded slot-key matches in the selected stock 240SX geometry:

| Geometry texture slot | Retail texture | Source | Evidence / role |
| --- | --- | --- | --- |
| `0x5799e60b` | `DRIVER` | `GLOBALB.BUN`, 64×64 DXT3 | Assigned to cabin/interior material hash `0x010cb64a`; alpha blended. |
| `0xd195be56` | `REAR_DEFROSTER` | `GLOBALB.BUN`, 128×128 DXT3 | Assigned to rear-window material hash `0x471a1dca` (also used by a run with hash `0x3ed70c43`); alpha blended. The decoded map contains the horizontal defroster lines. |
| `0xbd1f0e0a` | `CARBOTTOM` | `GLOBALB.BUN`, 256×64 DXT1 | Matched underside/related slice. |

The regenerated stock-car GLBs also include applicable shared `CHROME` and `BRAKE_STYLE00` maps. 240SX material extras retain the texture-slot key, resolved texture name and retail alpha mode so the assignments can be audited. The packaged driving screenshot is `webgl-city/review/images/430-r295-240sx-shared-textures-city-drive.png`; it shows the defroster map in the city view.

## What remains unavailable

The main 240SX body slot `0x3c84d757` did not resolve to a source image in the car-local `TEXTURES.BIN` or `VINYLS.BIN`, shared `CARS/TEXTURES.BIN`, wheel texture pack, or `GLOBALB.BUN`. The exporter therefore cannot assign a source-backed body image. The visible neutral body color is a viewer fallback, not a decoded paint texture. Retail body paint is supplied through runtime paint/material state; actual color/finish selection must be captured from a running game.

The recovered rear-window defroster image provides the line overlay, but it does not recover the glass pane's runtime transparency/refraction settings. Side windows remain limited by missing material state too.

## Exact next capture

In the XP game, load the 240SX in a garage or on the road with a known paint and finish selected. Capture a frame at that moment and record the player-car paint state packet/material update and texture-slot bindings as the frame is submitted. Preserve the selected car ID, paint/finish option IDs, per-material color/alpha/reflectance values, bound texture handles, and the frame's texture-memory snapshot. That runtime handoff is required to map the current body slot to a real paint source or establish that it is procedural, and to recover glass transparency values.

## Named paint-state payload check, r321

The installed `GLOBALB.BUN` TPK contains 203 named texture records; none is
named for paint, color, pearl, or metal paint. The body material texture key
`0x3c84d757` still has no matching image in the source packs checked above.

The `0x34605` paint-state map also exports named records such as
`REGPAINTRED` and `REGPAINTBLUE`, but their 96-byte payloads are 24 shader
floats, not bitmap pixels or a direct RGB swatch. The executable maps the
leading fields as `D0 = s30*(s34,s38,s3c)` and
`D1 = s40*(s44,s48,s4c)`. For `REGPAINTRED`, those evaluate to approximately
`(0.878,0.872,0.754)` and `(1.011,1.000,1.116)`; for `REGPAINTBLUE`, they
evaluate to `(0.662,0.655,0.672)` and `(1.072,1.072,0.923)`. These vectors
remain near neutral and are only shader minima/ranges. The recovered
programmable shader multiplies them by the separate live harmonic lighting
function and samples its base texture. The record names alone therefore do
not recover the visible pigment color or finish.

This static check does not make a source-backed WebGL paint change. The missing
input remains the correlated live player draw: selected state, bound base
texture, and lighting packet. Keep the current body-shop color picker clearly
identified as a preview until that handoff is captured.
