Studio Gltf Web Asset
Install this skill
No account required. Pick your tool, then copy.
Run in your terminal. It detects your AI tool.
npx @skills-hub-ai/cli install studio-gltf-web-assetWhat this does: Model or convert 3D assets to glTF/GLB for the web with poly and texture budgets, Draco or meshopt plus KTX2 compression via gltf-transform, a Three.js or model-viewer preview, and size plus gltf-validator checks. Triggers: "optimize this GLB", "3D model for the web", "convert FBX to glTF", "compress textures KTX2".
Manual setup by platform
Claude Code
~/.claude/skills/studio-gltf-web-asset/SKILL.md
Cursor
~/.cursor/skills/studio-gltf-web-asset/SKILL.md
Codex CLI
~/.codex/skills/studio-gltf-web-asset/SKILL.md, or reference via codex.md instructions file
Signing
SignedSLSA L2- Signed by
- skills-hub.ai distributor
- Method
- Distributor-signed by skills-hub.aiSigned with the skills-hub.ai Ed25519 distributor key over this exact slug, version and content. Check it with `npx @skills-hub-ai/cli verify`.
- Key
- skills-hub-ed25519-2026-11
- Signed
Instructions
glTF web asset
A web 3D asset is done when it looks right, loads fast on a mid-range phone and passes the validator with zero errors.
Inputs to agree on
- Source: Blender file, FBX, OBJ, CAD export, photogrammetry scan, or an existing GLB.
- Viewer: Three.js app,
<model-viewer>, Babylon.js, or AR (Scene Viewer, Quick Look needs USDZ). - Budgets (typical product viewer on mobile):
- Triangles: 50k to 100k hero, under 20k for many-object scenes.
- Textures: 2048 max for hero base color, 1024 for normal/ORM on small items; KTX2 compressed.
- Download: under 5 MB hero, under 1 MB for inline items.
- Draw calls: as few materials as possible (1 to 5).
- Required features: animations, morph targets, variants (
KHR_materials_variants), AR.
Toolchain
- Blender 4.x glTF exporter (built in) for modeling, baking and export.
@gltf-transform/clifor inspect, optimize, compress:npm i -g @gltf-transform/cli.- KTX-Software (
toktx) is required by gltf-transform for KTX2 encoding; install it and ensure it is on PATH. gltf-validator(Khronos):npm i -g gltf-validatorprovides the library; the CLI binary is published on the KhronosGroup glTF-Validator releases page. The web drop-in at github.khronos.org/glTF-Validator also works.- Alternatives:
gltfpack(meshoptimizer) for one-shot simplify plus compress; FBX2glTF for FBX;obj2gltf.
Workflow
1. Prepare in Blender
- Apply scale and rotation (Ctrl+A), real-world meters, Y-up is handled by the exporter.
- Remove hidden geometry, inner faces and unused materials. Merge materials where possible and bake to a single texture set (base color, normal, ORM where R=occlusion, G=roughness, B=metallic).
- For high-poly scans or CAD: decimate or retopologize, then bake normals from high to low.
- Export:
import bpy
bpy.ops.export_scene.gltf(
filepath="asset.glb", export_format="GLB",
export_apply=True, export_yup=True,
export_texcoords=True, export_normals=True,
export_draco_mesh_compression_enable=False, # compress later with gltf-transform
export_animations=True,
)
Converting an FBX directly: FBX2glTF -b -i model.fbx -o model (outputs GLB).
2. Inspect
gltf-transform inspect asset.glb
Read the meshes table (vertices, primitives), textures (resolution, size in bytes, format) and extensions used. Large textures are usually most of the file.
3. Optimize
One command covering dedup, prune, weld, simplify, texture resize and compression:
gltf-transform optimize asset.glb asset.opt.glb \
--compress meshopt \
--texture-compress ktx2 \
--texture-size 2048 \
--simplify true --simplify-ratio 0.5 --simplify-error 0.001
Step-by-step when you need control:
gltf-transform dedup asset.glb a.glb
gltf-transform prune a.glb a.glb
gltf-transform weld a.glb a.glb
gltf-transform simplify a.glb a.glb --ratio 0.5 --error 0.001
gltf-transform resize a.glb a.glb --width 2048 --height 2048
gltf-transform etc1s a.glb a.glb --slots "{baseColorTexture,emissiveTexture}" --quality 255
gltf-transform uastc a.glb a.glb --slots "{normalTexture,occlusionTexture,metallicRoughnessTexture}" --level 2 --zstd 18
gltf-transform meshopt a.glb asset.opt.glb
Use UASTC for normal and ORM maps (ETC1S artifacts break normals) and ETC1S for color maps where size matters. Choose Draco (gltf-transform draco) for the smallest geometry on static meshes; choose meshopt for faster decode and support for animation and morph targets. Flags change between versions, so confirm with gltf-transform <command> --help.
4. Validate
gltf_validator asset.opt.glb -o # writes asset.opt.report.json
Require 0 errors. Review warnings (unused objects, non-normalized vectors). Then re-run gltf-transform inspect to confirm budgets.
5. Preview
<model-viewer> (fastest to ship):
<script
type="module"
src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"
></script>
<model-viewer
src="asset.opt.glb"
alt="Product name, 3D view"
camera-controls
touch-action="pan-y"
shadow-intensity="1"
environment-image="neutral"
exposure="1"
ar
ar-modes="webxr scene-viewer quick-look"
style="width:100%;height:480px"
></model-viewer>
model-viewer decodes Draco, meshopt and KTX2 automatically.
Three.js (needs decoders wired):
import * as THREE from "three";
import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
import { KTX2Loader } from "three/addons/loaders/KTX2Loader.js";
import { DRACOLoader } from "three/addons/loaders/DRACOLoader.js";
import { MeshoptDecoder } from "three/addons/libs/meshopt_decoder.module.js";
import { RoomEnvironment } from "three/addons/environments/RoomEnvironment.js";
const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.toneMapping = THREE.ACESFilmicToneMapping;
const scene = new THREE.Scene();
scene.environment = new THREE.PMREMGenerator(renderer).fromScene(
new RoomEnvironment(),
).texture;
const ktx2 = new KTX2Loader()
.setTranscoderPath("/basis/")
.detectSupport(renderer);
const draco = new DRACOLoader().setDecoderPath("/draco/");
const loader = new GLTFLoader()
.setKTX2Loader(ktx2)
.setDRACOLoader(draco)
.setMeshoptDecoder(MeshoptDecoder);
loader.load("asset.opt.glb", (gltf) => scene.add(gltf.scene));
Copy the transcoder and decoder files from three/examples/jsm/libs/basis and .../draco into your public folder.
6. Serve correctly
- MIME:
model/gltf-binaryfor .glb,image/ktx2for .ktx2. - Long cache with a content hash in the filename. Do not gzip an already compressed GLB heavily; Brotli gains little on Draco/meshopt data.
Variants
- AR on iOS: export USDZ (Blender USD export or Reality Converter) and pass it via
ios-src. - Many small assets: share textures in a
.gltfplus external files, or atlas them. - Animated characters: meshopt (Draco does not cover animation), keep skin weights to 4 influences, resample animations with
gltf-transform resample. - Photogrammetry: simplify aggressively, bake detail into a normal map, cap at 4096 texture only for hero.
Quality checks
- Validator: 0 errors.
- File size within budget (
ls -l, plus each texture's size from inspect). - Triangle count within budget.
- Visual diff: screenshot the original and optimized models from the same camera; no visible seams, flipped normals or banded color.
- Load on a mid-range phone over throttled 4G: first render under about 3 s for a hero model.
- GPU memory: KTX2 textures stay compressed on GPU; PNG/JPG expand to width x height x 4 bytes each.
Pitfalls and fixes
- Black or missing textures in Three.js: KTX2Loader not registered or transcoder path wrong.
- Model too small or rotated: scale not applied before export.
- Normal map looks inverted: glTF uses OpenGL-style (Y+) normals; flip green channel from DirectX bakes.
- Simplify destroyed silhouette: lower the ratio change, raise
--errorlimit carefully, or lock borders; check UV seams. - Transparent materials sorting wrong: use alpha mode MASK where possible instead of BLEND.
- toktx not found: install KTX-Software; gltf-transform shells out to it.
Deliverables
-
asset.opt.glbwithin budgets - Validator report JSON with 0 errors
- Inspect output before and after (size, triangles, textures)
- Preview page (model-viewer or Three.js) with decoders set up
- USDZ if AR on iOS was requested
- Source .blend and the exact optimize commands
Security
Reviews (0)
Related skills
Browse all →More from Skills Hub
View source →More Build skills
Browse category →Frequently asked questions about studio-gltf-web-asset
What does the studio-gltf-web-asset skill do?
Model or convert 3D assets to glTF/GLB for the web with poly and texture budgets, Draco or meshopt plus KTX2 compression via gltf-transform, a Three.js or model-viewer preview, and size plus gltf-validator checks. Triggers: "optimize this GLB", "3D model for the web", "convert FBX to glTF", "compress textures KTX2". It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the studio-gltf-web-asset skill?
Run `npx @skills-hub-ai/cli install studio-gltf-web-asset` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/studio-gltf-web-asset/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does studio-gltf-web-asset work with?
studio-gltf-web-asset runs in Claude Code, Cursor, Codex CLI. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the studio-gltf-web-asset skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use studio-gltf-web-asset after installing it?
In Claude Code, type `/studio-gltf-web-asset` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the studio-gltf-web-asset skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.