threejs-glb-pipeline

Implements optimized Three.js GLB asset loading pipelines with compression, cloning, and pooling.

Updated Jul 13, 2026
One-click install
npx skills add https://github.com/Ohmnia/site-build --skill threejs-glb-pipeline-ohmnia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-glb-pipeline
Source: https://github.com/Ohmnia/site-build/tree/main/.opencode/skills/threejs-glb-pipeline
Command: npx skills add https://github.com/Ohmnia/site-build --skill threejs-glb-pipeline-ohmnia

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires three.

What problem does it solve? Building 3D RTS or large-scale web games in Three.js often leads to performance bottlenecks: duplicate asset loads, excessive draw calls, unbounded animation updates, and runtime memory allocation that stalls the main thread. This Skill enforces a disciplined asset pipeline so thousands of units render smoothly within strict CPU and GPU budgets. ## Core Features & Use Cases - Unified Asset Caching: Implements an AssetManager that loads each GLB exactly once, caches it globally, and clones instances via SkeletonUtils without duplicating materials. - Compression & Texture Pipeline: Binds DRACOLoader, MeshoptDecoder, and KTX2Loader to GLTFLoader for minimal network payloads and GPU texture memory. - Performance Guardrails: Enforces draw call limits, LOD meshes, animation culling by camera distance, shadow restrictions, and object pooling with typed arrays. - Use Case: When building an RTS game with hundreds of on-screen units, use this Skill to refactor naive loader code into a pooled, compressed, single-draw-call asset architecture that passes the pre-shipping audit checklist. ## Quick Start Use the threejs-glb-pipeline skill to refactor my GLTFLoader code into a cached asset manager with Draco compression and SkeletonUtils cloning.

Frequently Asked Questions about threejs-glb-pipeline

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I load GLB models efficiently in Three.js?

Load each GLB exactly once through a centralized AssetManager that caches loaded GLTF objects in a Map keyed by URL. Clone instances with SkeletonUtils.clone() so skeletal hierarchies are decoupled without duplicating materials or geometry.

How to set up Draco and Meshopt compression with GLTFLoader?

Create a DRACOLoader instance pointing to local decoder binaries at /draco/ and attach it via gltfLoader.setDRACOLoader(). Then call gltfLoader.setMeshoptDecoder(MeshoptDecoder) so both compression formats decode correctly during loading.

Does SkeletonUtils clone skinned meshes correctly in Three.js?

Yes, SkeletonUtils.clone() properly duplicates skinned meshes by rebuilding the bone hierarchy and rebinding skeletons, unlike Object3D.clone() which shares skeleton references. Use it whenever instancing animated GLB assets from a cache.

Why does my Three.js RTS game lag with many units?

Lag typically comes from excessive draw calls, ungated AnimationMixer updates, and runtime object allocation. Cap draw calls under 200, update mixers only for visible nearby units, disable shadows on standard units, and pre-allocate objects in pools.

What texture format should I use for Three.js web games?

Use KTX2 compressed textures loaded through KTX2Loader with a transcoder path configured. KTX2 reduces GPU texture memory significantly compared to PNG or JPEG, and pair it with texture atlases to keep materials at one per unit type.

When should I use InstancedMesh versus cloned meshes in Three.js?

Use InstancedMesh for large groups of identical static or simply-animated geometry to collapse them into a single draw call. Use SkeletonUtils clones when units need independent skeletal animations, accepting higher draw call counts within budget.