Bladeren bron

chore(deploy): setup_gltftool.sh for the web-optimize step + README note

Oivo Agent 1 week geleden
bovenliggende
commit
48e119fb5e
2 gewijzigde bestanden met toevoegingen van 24 en 0 verwijderingen
  1. 13 0
      README.md
  2. 11 0
      backend/setup_gltftool.sh

+ 13 - 0
README.md

@@ -54,3 +54,16 @@ serve the demo scene before the model is ready.
 `backend/pipeline.py` assembles `<job>/images/` + `<job>/colmap/{cameras,images,points3D}.txt`
 (what the README implies). During the i-opavuyaq Step-2 smoke test, confirm `reconstruct_scene.py
 --mode Iphone` actually finds that layout; adjust `run_colmap` / `_reconstruct_cmd` if not.
+
+## Deploy: web-optimized walkthrough (optional but recommended)
+
+Reconstructed meshes are 100s of MB. `backend/optimize_glb.sh` (called automatically
+by the glb stage) shrinks them to a browser-loadable size (simplify + webp). It needs
+a one-time local gltf-transform install:
+
+```sh
+bash backend/setup_gltftool.sh   # installs to /opt/genrecon/gltftool
+```
+
+Without it the pipeline still works — it just serves the full-res `scene.glb`.
+Tune via `GENRECON_SIMPLIFY_RATIO` (default 0.12) and `GENRECON_TEX_SIZE` (2048).

+ 11 - 0
backend/setup_gltftool.sh

@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+# One-time setup: LOCAL gltf-transform install used by optimize_glb.sh to shrink
+# reconstructed glbs for the browser walkthrough. Kept out of the app venv and the
+# global npm prefix so @gltf-transform/core is deduped to ONE copy — a split core
+# between two separate global installs dies with "null.getLogger". Run on deploy.
+set -euo pipefail
+DIR="${GENRECON_GLTFTOOL_DIR:-/opt/genrecon/gltftool}"
+mkdir -p "$DIR"; cd "$DIR"
+[ -f package.json ] || npm init -y -s >/dev/null
+npm install @gltf-transform/cli@4.4.0 @gltf-transform/functions@4.4.0 --no-fund --no-audit
+echo "gltf-transform ready: $DIR/node_modules/.bin/gltf-transform"