
Threejs Loaders
Load GLTF models, textures, HDR environments, and coordinate multi-asset progress with LoadingManager in Three.js web 3D scenes.
Install
npx skills add https://github.com/cloudai-x/threejs-skills --skill threejs-loadersWhat is this skill?
- GLTF/GLB model loading with scene.add patterns
- TextureLoader and image asset loading
- LoadingManager for multi-asset progress, onLoad, onProgress, onError
- Async load coordination before starting interactive scenes
Adoption & trust: 3.3k installs on skills.sh; 2.3k GitHub stars; 2/3 security scanners passed (skills.sh audits).
Recommended Skills
Frontend Designanthropics/skills
Vercel React Best Practicesvercel-labs/agent-skills
Remotion Best Practicesremotion-dev/skills
Vercel Composition Patternsvercel-labs/agent-skills
Develop Userscriptsxixu-me/skills
Next Best Practicesvercel-labs/next-skills
Journey fit
Primary fit
Asset loading is core frontend 3D implementation work during product build, before ship-time performance tuning. Covers GLTFLoader, TextureLoader, LoadingManager callbacks, and async load patterns—canonical browser 3D frontend shelf.
Common Questions / FAQ
Is Threejs Loaders safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Threejs Loaders
# Three.js Loaders ## Quick Start ```javascript import * as THREE from "three"; import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js"; // Load GLTF model const loader = new GLTFLoader(); loader.load("model.glb", (gltf) => { scene.add(gltf.scene); }); // Load texture const textureLoader = new THREE.TextureLoader(); const texture = textureLoader.load("texture.jpg"); ``` ## LoadingManager Coordinate multiple loaders and track progress. ```javascript const manager = new THREE.LoadingManager(); // Callbacks manager.onStart = (url, loaded, total) => { console.log(`Started loading: ${url}`); }; manager.onLoad = () => { console.log("All assets loaded!"); startGame(); }; manager.onProgress = (url, loaded, total) => { const progress = (loaded / total) * 100; console.log(`Loading: ${progress.toFixed(1)}%`); updateProgressBar(progress); }; manager.onError = (url) => { console.error(`Error loading: ${url}`); }; // Use manager with loaders const textureLoader = new THREE.TextureLoader(manager); const gltfLoader = new GLTFLoader(manager); // Load assets textureLoader.load("texture1.jpg"); textureLoader.load("texture2.jpg"); gltfLoader.load("model.glb"); // onLoad fires when ALL are complete ``` ## Texture Loading ### TextureLoader ```javascript const loader = new THREE.TextureLoader(); // Callback style loader.load( "texture.jpg", (texture) => { // onLoad material.map = texture; material.needsUpdate = true; }, undefined, // onProgress - not supported for image loading (error) => { // onError console.error("Error loading texture", error); }, ); // Synchronous (returns texture, loads async) const texture = loader.load("texture.jpg"); material.map = texture; ``` ### Texture Configuration ```javascript const texture = loader.load("texture.jpg", (tex) => { // Color space (important for color accuracy) tex.colorSpace = THREE.SRGBColorSpace; // For color/albedo maps // tex.colorSpace = THREE.LinearSRGBColorSpace; // For data maps (normal, roughness) // Wrapping tex.wrapS = THREE.RepeatWrapping; tex.wrapT = THREE.RepeatWrapping; // ClampToEdgeWrapping, RepeatWrapping, MirroredRepeatWrapping // Repeat/offset tex.repeat.set(2, 2); tex.offset.set(0.5, 0.5); tex.rotation = Math.PI / 4; tex.center.set(0.5, 0.5); // Filtering tex.minFilter = THREE.LinearMipmapLinearFilter; // Default tex.magFilter = THREE.LinearFilter; // Default // NearestFilter - pixelated // LinearFilter - smooth // LinearMipmapLinearFilter - smooth with mipmaps // Anisotropic filtering (sharper at angles) tex.anisotropy = renderer.capabilities.getMaxAnisotropy(); // Flip Y (usually true for standard textures) tex.flipY = true; tex.needsUpdate = true; }); ``` ### CubeTextureLoader For environment maps and skyboxes. ```javascript const loader = new THREE.CubeTextureLoader(); // Load 6 faces const cubeTexture = loader.load([ "px.jpg", "nx.jpg", // positive/negative X "py.jpg", "ny.jpg", // positive/negative Y "pz.jpg", "nz.jpg", // positive/negative Z ]); // Use as background scene.background = cubeTexture; // Use as environment map scene.environment = cubeTexture; material.envMap = cubeTexture; ``` ### HDR/EXR Loading ```javascript import { RGBELoader } from "three/addons/loaders/RGBELoader.js"; import { EXRLoader } from "three/addons/loaders/EXRLoader.js"; // HDR const rgbeLoader = new RGBELoader(); rgbeLoader.load("environment.hdr", (texture) => { texture.mapping = THREE.EquirectangularReflectionMapping; scene.environment = texture; scene.background = texture; }); // EXR const exrLoader = new EXRLoader(); exrLoader.load("environment.exr", (texture) => { texture.mapping = THREE.EquirectangularReflectionMapping; scene.environme