# Player-car source vinyl masks

## Extraction

Each installed `CARS/<car>/VINYLS.BIN` contains named P8 mask records separate
from the selected stock car's `TEXTURES.BIN` dependencies. The exporter reads
the resource name stored immediately before the 120-byte texture header,
retains records named `<CAR>_*_MASK`, decodes the indexed pixels and BGRA
palette, and writes 512×512 PNGs. The masks use each stock car's own body UVs.

The catalog exporter scans all 29 stock-car entries in
`reverse-engineering/garage-cars/manifest.json`:

```sh
python3 tools/export_nfsu2_vinyl_catalog.py /path/to/installed/game /tmp/vinyl-catalog
```

It writes one directory per car and a combined `catalog.json`. The viewer loads
only the selected mask image; it does not upload the full catalog's images at
startup. In r230, complete catalogs are packaged for:

| Car | Masks |
|---|---:|
| 240SX | 832 |
| 3000GT | 742 |
| 350Z | 853 |
| A3 | 873 |
| CELICA | 742 |
| CIVIC | 832 |
| COROLLA | 410 |
| ECLIPSE | 409 |
| ESCALADE | 282 |
| FOCUS | 832 |
| G35 | 861 |
| GOLF | 852 |
| GTO | 862 |
| HUMMER | 742 |
| IMPREZAWRX | 40 |
| IS300 | 832 |
| LANCEREVO8 | 40 |
| MIATA | 832 |
| MUSTANGGT | 107 |
| NAVIGATOR | 107 |

The fleet scan is still running for the remaining models. Newly completed
per-car exports can be merged into the source and packaged viewers with:

```sh
python3 tools/package_nfsu2_vinyl_catalog.py /tmp/vinyl-catalog \
  webgl-city/assets/vinyls --dist dist/webgl-city/assets/vinyls
```

## Viewer behavior and limits

The body shop searches the retail resource names and applies a chosen mask over
the viewer's selected body color. Mask artwork and mapping are source-derived.
The ink color, paint color, and finish are preview settings because the retail
saved paint state has not been recovered. The body itself has no complete paint
diffuse image in the stock export; its paint color is a runtime value.

The packaged Chrome captures in the [review feed](../webgl-city/review/) show
the 350Z source mask and the Corolla's 410-entry searchable catalog. The paired
Corolla images also show the city before and after all 114 nearby textures
finish uploading. The white angular forms in the partial capture are missing
texture uploads; they disappear in the fully textured frame. Dark pavement and
the neutral, flat body appearance remain unresolved.
