# KTX2 texture transcoder for johnmcm.com Used by the 3D Model Viewer (/model-viewer) to decode KTX2 (Basis Universal) textures in compressed glTF and GLB files. It is the [Basis Universal](https://github.com/BinomialLLC/basis_universal) transcoder (Apache-2.0, Binomial LLC) as three.js 0.160.1 ships it in `examples/jsm/libs/basis/`. - `basis_transcoder.wasm` is used exactly as published. - `basis_transcoder.js`, the Emscripten glue, is patched by `patch.mjs`: its embind layer compiles generated source text with `new Function`, which this site's Content Security Policy does not allow. The four functions that do that are rewritten as closures doing the same steps, as Emscripten does when built with `-sDYNAMIC_EXECUTION=0`. Nothing else is changed. To rebuild, run `node wasm-src/basis/patch.mjs` from `frontend/`. It downloads both files, checks their hashes, patches the glue and writes `frontend/vendor/local/basis@1/`; then run `node scripts/vendor-local-lock.mjs`.