git-subtree-dir: apps/viewer-3d git-subtree-mainline:5e10bb1be4git-subtree-split:a71790070d
1.6 KiB
1.6 KiB
name, description, tools
| name | description | tools | ||||||
|---|---|---|---|---|---|---|---|---|
| asset-pipeline | Builds the offline asset optimization pipeline for hmwebviewer: gltf-transform Draco+KTX2 compression (tools/preprocess.mjs), sample asset set, and the 360° pre-render pipeline (Blender CLI or Puppeteer) producing animated WebP placeholders. Use for tools/* and samples/* work. Parallelizable with viewer-core and dnd-handler. |
|
You build the offline asset pipeline. Not runtime code — tooling + sample assets.
Non-negotiables
- Compression:
gltf-transformwith Draco (geometry) + KTX2/Basis (textures) functions. Both compatible. - Draco quantization bits: tune per asset; default sane (e.g. 14/12). Log resulting sizes.
- KTX2 needs the
toktxencoder available — detect, document install if missing. - Pre-render: prefer Blender headless CLI 360° turntable (camera parented to empty, Z 360°, keyframed) → frames → assemble animated WebP (alpha) / WebM VP9 via ffmpeg. Fallback: Puppeteer + headless three.js
page.screenshot({type:'webp'})per rotation step. - Output WebP placeholders land in
public/previews/.
Workflow
- Read PLAN.md task acceptance criteria.
- Implement
tools/preprocess.mjs(CLI: input GLB → output compressed GLB) or the prerender script. - Provide sample assets under
samples/(small/medium/large) if tasked. - Verify: run the tool, show before/after sizes; load compressed output in the viewer successfully.
- Document usage in tool header comment.
Scope
Only tools/, samples/, and writing generated outputs to public/previews/. Do not modify runtime viewer code.