Tooluck logoTooluck
SKILL.md

threejs-asset-pipeline

Agent skill fromCloudAI-X/threejs-skills

Shrinking glTF assets for three.js with gltf-transform: inspect, validate and optimize commands, Draco, meshopt and quantization, KTX2, WebP and AVIF textures, the loader setup each output needs, and gltfjsx for React. Use when compressing, optimizing or validating 3D models before loading them.

How to install threejs-asset-pipeline

install threejs-asset-pipeline
# install the threejs-skills pack with the skills CLI
npx skills add CloudAI-X/threejs-skills

# or add only this skill to Claude Code: copy the folder

skills/threejs-asset-pipeline/

# into

~/.claude/skills/threejs-asset-pipeline/ (all projects)

.claude/skills/threejs-asset-pipeline/ (one project)

skills/threejs-asset-pipeline/SKILL.md

MITFull file
1# Three.js Asset Pipeline
2
3Targets three.js r186. Examples use WebGLRenderer; the WebGPU and TSL section uses WebGPURenderer.
4
5## Quick Start
6
7Compress on the command line, then load the result. Run `inspect` before and after to see what the pass saved:
8
9```bash
10npx @gltf-transform/cli inspect model.glb
11npx @gltf-transform/cli optimize model.glb model.opt.glb --compress draco --texture-compress webp --texture-size 2048
12npx @gltf-transform/cli inspect model.opt.glb
13```
14
15Draco output needs a DRACOLoader attached; WebP textures decode in the browser:
16
17```javascript
18import * as THREE from "three";
19import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
20import { DRACOLoader } from "three/addons/loaders/DRACOLoader.js";
21
22const renderer = new THREE.WebGLRenderer({ antialias: true });
23renderer.setPixelRatio(window.devicePixelRatio);
24renderer.setSize(window.innerWidth, window.innerHeight);
25document.body.appendChild(renderer.domElement);
26
27const scene = new THREE.Scene();
28const sun = new THREE.DirectionalLight(0xffffff, 2); // glTF PBR materials render black without lights or an environment
29sun.position.set(3, 5, 2);
30scene.add(sun, new THREE.HemisphereLight(0xffffff, 0x444444, 1.5));
31
32const camera = new THREE.PerspectiveCamera(50, window.innerWidth / window.innerHeight, 0.1, 100);
33camera.position.set(2, 1.5, 3);
34camera.lookAt(0, 0, 0);
35
36const gltf = await new GLTFLoader()
37 .setDRACOLoader(new DRACOLoader()) // the Draco WASM decoder loads from the three package
38…

Excerpt shown under the repository's MIT license.

More skills in threejs-skills

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates