Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

glb-web-export

БесплатноЗапускает вложенные скриптыНе проверен

Audit a .glb or .gltf and make it small, correct, and fast to load in a browser, with a measured before/after report. Use when a model is "too big" or "slow…

pascalorgот pascalorg★ 103 звезды на GitHub

Об этом скилле

GLB Web Export

Take a .glb/.gltf that came out of Blender, a CAD tool, a photogrammetry pipeline, or a Pascal export, and turn it into an asset a browser can download and render quickly — without silently breaking the things the app depends on.

The deliverable is not a smaller file. It is a smaller file plus a report that proves nothing regressed.

When to Use

  • A .glb/.gltf is too big, slow to load, or blows up GPU memory
  • Preparing an asset for Three.js, R3F/drei, Babylon.js, or <model-viewer>
  • Choosing between Draco, meshopt, and no geometry compression
  • Choosing between KTX2/Basis, WebP, and resized PNG/JPEG for textures
  • Auditing an asset before shipping it, or diagnosing why it loads slowly

When NOT to Use

  • Editing or modelling geometry, or laying out/authoring a scene
  • Generating a 3D model from text, an image, or a floor plan
  • Converting from FBX/OBJ/STEP (do the conversion first, then use this skill)
  • Runtime frame-rate problems unrelated to asset size (shaders, physics, effects)

Workflow

1. Measure  →  2. Decide  →  3. Apply  →  4. Verify  →  5. Report

Never skip step 1. An optimization with no measured before is a guess.


1. Measure

Keep the original. Every command below writes a new file; never optimize in place.

cp model.glb model.original.glb

Check the tool versions rather than assuming (package names and versions move):

npm view @gltf-transform/cli version
npm view gltfpack version

Inspect, then validate against the spec:

npx @gltf-transform/cli inspect model.glb
npx @gltf-transform/cli validate model.glb

inspect gives resolution and gpuSize per texture, per-mesh vertex/triangle counts, and the extension list. validate runs the Khronos validator (the gltf-validator npm package is a library with no CLI — npx gltf-validator fails with "could not determine executable to run"; gltf-transform validate wraps it, verified with @gltf-transform/[email protected] bundling [email protected]).

Then capture the numbers you will be judged on:

bash <skill-path>/scripts/glb-audit.sh model.glb

It reports raw/gzip/brotli bytes, texture VRAM, draw calls, triangles, world-space bounds in metres, named nodes, and required extensions. Pass a second path after optimizing to get a delta plus an automatic regression list.

Read inspect to answer: is this texture-heavy (large size/gpuSize), geometry-heavy (high vertex counts, f32 attributes), draw-call-heavy (many mesh primitives), or just dirty (unused materials, duplicate textures)? The answer decides step 2.


2. Decide

Geometry compression — pick exactly one

Situation Choice
Target loader can be given a decoder (Three.js setMeshoptDecoder, Babylon 5+, <model-viewer> with meshoptDecoderLocation set) meshopt — EXT_meshopt_compression, fastest decode, compresses geometry and animation
Draco decoder is already wired, or the consumer is Draco-only Draco — KHR_draco_mesh_compression, geometry only
You cannot confirm what will load the file Neither. Use quantize only (KHR_mesh_quantization) or plain float geometry

How to check the loader before choosing — do not guess:

  • Three.js — grep the app for setMeshoptDecoder / setDRACOLoader. Absent means the extension will fail to load.
  • R3F/drei — useGLTF enables Draco and meshopt by default; KTX2 needs extendLoader.
  • <model-viewer> — Draco and KTX2 decoders load from a CDN by default; meshopt is not enabled by default.
  • Babylon.js — Draco, meshopt, and KTX2 are built in and fetch decoders from the Babylon CDN.

Exact API names, defaults and doc URLs: references/loader-support.md.

Textures — usually the biggest win

Resize first. Halving each dimension quarters both bytes and VRAM, and no codec recovers a 4× texel reduction.

Situation Choice
Loader supports KHR_texture_basisu and VRAM matters KTX2 — etc1s (small) or uastc (normal maps, high quality). Stays block-compressed on the GPU
Loader has no KTX2 support, or you want minimal setup WebP (EXT_texture_webp) or a resized PNG/JPEG. Decodes to RGBA8 in VRAM

KTX2 wins on VRAM by roughly 6–8× over WebP at the same resolution, because PNG/JPEG/WebP/AVIF are fully decompressed in GPU memory while ETC1S/UASTC are not. On the fixture: 5.33 MiB VRAM (WebP) vs 0.67 MiB (ETC1S), same 1024px source.

Structural passes

Cheap, lossless, run these first: dedup (duplicate accessors/textures/ materials/meshes), prune (unreferenced properties), weld (merge bitwise identical vertices, producing an index buffer), quantize (f32 → i8/i16).

Structure-changing, opt in deliberately: instance (shared meshes → EXT_mesh_gpu_instancing, cuts draw calls, erases the per-node names), flatten (collapse the hierarchy), join (merge primitives — can increase siz

Полный SKILL.md на GitHub

Установить glb-web-export в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

evals/trigger-evals.jsonexamples/textured-scene.mdreferences/commands.mdreferences/correctness-checklist.mdreferences/loader-support.mdscripts/glb-audit.mjsscripts/glb-audit.shscripts/make-fixture.mjsscripts/make-fixture.shscripts/package-lock.jsonscripts/package.json

FAQ

Что делает скилл glb-web-export?

Audit a .glb or .gltf and make it small, correct, and fast to load in a browser, with a measured before/after report. Use when a model is "too big" or "slow to load", when the user asks to "optimize this GLB", "compress this glTF", or "export for web", or when they mention Draco, meshopt, gltfpack, KTX2, Basis, texture VRAM, draw calls, or a Blender / CAD / photogrammetry / Pascal export headed for Three.js, React Three Fiber (drei useGLTF), Babylon.js, or model-viewer. Covers inspection, spec validation, geometry and texture compression, scene-graph cleanup, and the correctness checks (metres, Y-up, node names, animations, PBR fidelity, alpha modes, vertex colors) that must not regress. Not for editing or modelling geometry, authoring or laying out a scene, generating 3D from text or images, converting from FBX/OBJ/CAD, or debugging a runtime frame rate that has nothing to do with asset size.

Как установить скилл glb-web-export?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл glb-web-export запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить glb-web-export с