git-subtree-dir: apps/viewer-3d git-subtree-mainline:5e10bb1be4git-subtree-split:a71790070d
792 B
792 B
description
| description |
|---|
| Run the offline asset optimization pipeline (gltf-transform Draco + KTX2) on a GLB file. Optionally pre-render a 360 WebP placeholder. |
Asset path required: $ARGUMENTS (e.g. /optimize-asset samples/robot.glb)
Steps:
- Confirm
tools/preprocess.mjsexists; if not, delegate to theasset-pipelineagent to build it first. - Run the compressor on the input GLB → output to
samples/<name>.optimized.glb. Print before/after sizes and the reduction %. - If a second arg
--prerenderis given, also run the 360° pre-render pipeline to producepublic/previews/<name>.webp. - Verify the optimized GLB still loads in the viewer (load test).
If gltf-transform or toktx (KTX2 encoder) is missing, report the install command and stop — do not silently skip.