#!/usr/bin/env python3 """PROCITY Lane E — strip_transmission.py (R39, the transmission pre-pass) Remove `KHR_materials_transmission` from a GLB **without touching one byte of geometry**. WHY THIS IS NOT A COSMETIC FIX. three.js renders a **transmission pre-pass** — a second full render of the opaque scene into a render target — as soon as ANY material in the scene has `transmission > 0` (`WebGLRenderer`'s transmissive-object list). Every opaque draw call in that scene is therefore issued **twice**. Lane C measured it in R39 by zeroing the bookshelf's: opshop/hall 191 -> 104 draws (-46%) · opshop/wide 142 -> 80 book/hall 101 -> 51 draws (-50%) · dept/hall 116 -> 116 (control, no bookshelf) Three PROCITY assets carry `transmissionFactor: 1`, and only one of them has ever been wired: procity_fit_bookshelf_01.glb mtl_10218_Bookshelves_v1 SHIPPED — the one C measured procity_street_longbench_01.glb lambert3SG + ior 1 NOT WIRED — the 5.86 m arcade bench procity_street_streetlight_01.glb Streetlight_HighResSG3 + ior 1 NOT WIRED — one per ~18 m of street The two unwired ones are the worse finding. They are STREET assets, LANE_E_NOTES R38 recommends both to Lane B, and the street budget is 292/300 with **eight draws of margin** — a transmission pre-pass there does not cost eight draws, it costs another ~292. Nobody looked because a bookshelf, a bench and a streetlight are not glass; this is an exporter default that rode in with the source meshes. python3 pipeline/strip_transmission.py FILE.glb [FILE ...] [--in-place] [--dry-run] The JSON chunk is rewritten and the BIN chunk is copied through untouched — the tool prints the sha1 of the BIN chunk before and after so "geometry unchanged" is a checked claim, not a promise. `KHR_materials_ior` is deliberately LEFT ALONE: ior alone does not trigger the pre-pass, and removing more than the defect widens the diff for no measured gain. """ import hashlib import json import os import struct import sys EXT = "KHR_materials_transmission" def read(path): d = open(path, "rb").read() assert d[:4] == b"glTF", f"{path}: not a GLB" off, gltf, binc = 12, None, b"" while off < len(d): clen, ctype = struct.unpack("