Threejs Syntax Loaders logo

Threejs Syntax Loaders

Organization
Impertio-Studio
threejs-syntax-loaders

Use when loading 3D models (GLTF, FBX, OBJ), textures, or HDR environment maps in Three.js. Prevents the common mistake of not setting up DRACOLoader, wrong WASM path, or missing error handling. Covers GLTFLoader, DRACOLoader, KTX2Loader, TextureLoader, RGBELoader, FBXLoader, OBJLoader, LoadingManager. Keywords: GLTFLoader, GLTF, GLB, load model, DRACOLoader, texture, FBXLoader, OBJLoader, RGBELoader, HDR, LoadingManager, progress, export, GLTFExporter, save model, download 3D, import 3D file.

Overview

PublisherImpertio-Studio
RepositoryThree.js-Claude-Skill-Package
Skill namethreejs-syntax-loaders
Stars
29
Forks
3
Bundled files
3
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Impertio-Studio on GitHub. Read the source before you install it.

Installation

Install the Threejs Syntax Loaders AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Impertio-Studio/Three.js-Claude-Skill-Package/tree/master/skills/source/threejs-syntax/threejs-syntax-loaders
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Impertio-Studio/Three.js-Claude-Skill-Package.git /tmp/Three.js-Claude-Skill-Package
mkdir -p .claude/skills
cp -r /tmp/Three.js-Claude-Skill-Package/skills/source/threejs-syntax/threejs-syntax-loaders .claude/skills/threejs-syntax-loaders
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Threejs Syntax Loaders in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Threejs Syntax Loaders on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Threejs Syntax Loaders is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

threejs-syntax-loaders

Quick Reference

Loader Architecture

All Three.js loaders extend the Loader base class and share two loading patterns:

javascript
// Callback style
loader.load(url, onLoad, onProgress, onError);

// Promise style (preferred)
const result = await loader.loadAsync(url, onProgress);

Import Paths

LoaderImport
TextureLoaderimport { TextureLoader } from 'three';
CubeTextureLoaderimport { CubeTextureLoader } from 'three';
GLTFLoaderimport { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
DRACOLoaderimport { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
KTX2Loaderimport { KTX2Loader } from 'three/addons/loaders/KTX2Loader.js';
FBXLoaderimport { FBXLoader } from 'three/addons/loaders/FBXLoader.js';
OBJLoaderimport { OBJLoader } from 'three/addons/loaders/OBJLoader.js';
MTLLoaderimport { MTLLoader } from 'three/addons/loaders/MTLLoader.js';
RGBELoaderimport { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
MeshoptDecoderimport { MeshoptDecoder } from 'three/addons/libs/meshopt_decoder.module.js';

Format Recommendation

ALWAYS prefer glTF/GLB over other 3D formats. glTF is the recommended format for Three.js. It supports PBR materials, animations, cameras, lights, and scene hierarchy in a single file. Use .glb (binary glTF) for single-file distribution.

Critical Warnings

NEVER call loader.load() inside requestAnimationFrame or any render loop. Load assets once at initialization and cache the result.

NEVER forget to set the DRACOLoader decoder path before loading Draco-compressed models. The path MUST point to a directory containing draco_decoder.wasm.

NEVER skip error handling on loadAsync calls. ALWAYS wrap in try/catch. Failed loads without error handlers crash silently.

NEVER forget to dispose loaded models when removing them. GLTF models contain meshes, materials, and textures that ALL require disposal.

ALWAYS set texture.colorSpace = THREE.SRGBColorSpace on diffuse/color textures (map, emissiveMap). NEVER set SRGBColorSpace on data textures (normalMap, roughnessMap, metalnessMap, aoMap).

ALWAYS call dracoLoader.dispose() after all Draco-compressed models are loaded to free the WASM decoder memory.


Loader Base Class

Every loader inherits these methods from Loader:

MethodSignaturePurpose
load(url, onLoad, onProgress, onError)Callback-based loading
loadAsync(url, onProgress) => PromisePromise-based loading
setPath(path: string)Set base URL prefix for all loads
setResourcePath(path: string)Set resource resolution path
setCrossOrigin(value: string)Set CORS mode
setWithCredentials(value: boolean)Enable credentials for cross-origin
setRequestHeader(header: object)Set custom HTTP headers

LoadingManager

Coordinates multiple loaders and tracks overall progress.

javascript
import * as THREE from 'three';

const manager = new THREE.LoadingManager(
  () => { console.log('All assets loaded'); },
  (url, loaded, total) => { console.log(`Progress: ${loaded}/${total}`); },
  (url) => { console.error(`Failed to load: ${url}`); }
);

// Pass manager to any loader
const textureLoader = new THREE.TextureLoader(manager);
const gltfLoader = new GLTFLoader(manager);

Manager Callbacks

CallbackSignatureWhen
onStart(url, itemsLoaded, itemsTotal)First item begins loading
onLoad()All items finished
onProgress(url, itemsLoaded, itemsTotal)Each item completes
onError(url)An item fails

Manager Methods

MethodPurpose
itemStart(url)Manually register a loading item
itemEnd(url)Manually mark item as loaded
itemError(url)Manually mark item as failed
resolveURL(url)Resolve URL through modifiers
setURLModifier(callback)Custom URL rewriting (blob URLs, service workers)

GLTFLoader

The primary loader for 3D models. glTF 2.0 supports meshes, PBR materials, animations, cameras, lights, and scene hierarchy.

Setup with Draco Compression

javascript
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';

const dracoLoader = new DRACOLoader();
dracoLoader.setDecoderPath('https://www.gstatic.com/draco/versioned/decoders/1.5.6/');

const gltfLoader = new GLTFLoader();
gltfLoader.setDRACOLoader(dracoLoader);

Setup with KTX2 Textures

javascript
import { KTX2Loader } from 'three/addons/loaders/KTX2Loader.js';

const ktx2Loader = new KTX2Loader();
ktx2Loader.setTranscoderPath('/basis/');
ktx2Loader.detectSupport(renderer); // MUST pass renderer instance

gltfLoader.setKTX2Loader(ktx2Loader);

Setup with Meshopt Decoder

javascript
import { MeshoptDecoder } from 'three/addons/libs/meshopt_decoder.module.js';

await MeshoptDecoder.ready;
gltfLoader.setMeshoptDecoder(MeshoptDecoder);

Loading a Model

javascript
try {
  const gltf = await gltfLoader.loadAsync('model.glb');
  scene.add(gltf.scene);
} catch (error) {
  console.error('Failed to load model:', error);
}

GLTF Result Object

javascript
{
  scene: THREE.Group,                    // Root scene node -- add this to your scene
  scenes: THREE.Group[],                 // All scenes in the file
  cameras: THREE.Camera[],              // Embedded cameras
  animations: THREE.AnimationClip[],    // Animation data for AnimationMixer
  asset: { generator: string, version: string },  // File metadata
  parser: GLTFParser,                    // Internal parser (advanced use)
  userData: {}                           // Custom glTF extensions
}

GLTFLoader Methods

MethodSignaturePurpose
load(url, onLoad, onProgress, onError)Load with callbacks
loadAsync(url, onProgress) => Promise<GLTF>Load with Promise
parse(data, path, onLoad, onError)Parse ArrayBuffer or JSON directly
setDRACOLoader(dracoLoader: DRACOLoader)Enable Draco decompression
setKTX2Loader(ktx2Loader: KTX2Loader)Enable KTX2 texture decompression
setMeshoptDecoder(decoder)Enable meshopt decompression
register(plugin)Register a glTF extension plugin
unregister(plugin)Unregister a glTF extension plugin

DRACOLoader

Decodes Draco-compressed geometry. Reduces mesh file size by 80-90%.

MethodSignaturePurpose
setDecoderPath(path: string)Path to directory containing WASM decoders
setDecoderConfig(config: object){ type: 'js' | 'wasm' } -- WASM is default and faster
preload()Pre-fetch decoder WASM before first use
dispose()Free WASM decoder memory

ALWAYS call dracoLoader.dispose() after loading all Draco-compressed models.


TextureLoader

Loads 2D textures (PNG, JPG, WebP) into THREE.Texture.

javascript
const loader = new THREE.TextureLoader();
const texture = await loader.loadAsync('diffuse.jpg');
texture.colorSpace = THREE.SRGBColorSpace; // ALWAYS for color textures
texture.wrapS = THREE.RepeatWrapping;
texture.wrapT = THREE.RepeatWrapping;
material.map = texture;

CubeTextureLoader

Loads six images as a cube map for skyboxes or environment reflections.

javascript
const cubeLoader = new THREE.CubeTextureLoader();
cubeLoader.setPath('/textures/cube/');
const cubeTexture = cubeLoader.load([
  'px.jpg', 'nx.jpg',  // positive-x, negative-x
  'py.jpg', 'ny.jpg',  // positive-y, negative-y
  'pz.jpg', 'nz.jpg'   // positive-z, negative-z
]);
scene.background = cubeTexture;
scene.environment = cubeTexture;

RGBELoader

Loads HDR environment maps in Radiance .hdr format.

javascript
import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';

const rgbeLoader = new RGBELoader();
rgbeLoader.load('environment.hdr', (texture) => {
  texture.mapping = THREE.EquirectangularReflectionMapping;
  scene.environment = texture; // PBR environment lighting
  scene.background = texture;  // Optional: visible HDR background
});

The RGBELoader sets color space automatically. NEVER manually override the color space on HDR textures.


FBXLoader

Loads Autodesk FBX models. Supports meshes, materials, and skeletal animations.

javascript
import { FBXLoader } from 'three/addons/loaders/FBXLoader.js';

const fbxLoader = new FBXLoader();
const model = await fbxLoader.loadAsync('character.fbx');
scene.add(model);

OBJLoader + MTLLoader

Loads Wavefront OBJ geometry with optional MTL material files.

javascript
import { OBJLoader } from 'three/addons/loaders/OBJLoader.js';
import { MTLLoader } from 'three/addons/loaders/MTLLoader.js';

const mtlLoader = new MTLLoader();
const materials = await mtlLoader.loadAsync('model.mtl');
materials.preload();

const objLoader = new OBJLoader();
objLoader.setMaterials(materials);
const model = await objLoader.loadAsync('model.obj');
scene.add(model);

ALWAYS load the MTL file first, then pass the materials to OBJLoader before loading the OBJ file.


Disposing Loaded Models

ALWAYS traverse and dispose ALL resources when removing a loaded model:

javascript
function disposeModel(model) {
  model.traverse((child) => {
    if (child.isMesh) {
      child.geometry.dispose();
      if (Array.isArray(child.material)) {
        child.material.forEach((mat) => {
          disposeMaterial(mat);
        });
      } else {
        disposeMaterial(child.material);
      }
    }
  });
  model.removeFromParent();
}

function disposeMaterial(material) {
  for (const key of Object.keys(material)) {
    const value = material[key];
    if (value && typeof value === 'object' && 'dispose' in value) {
      value.dispose(); // Disposes textures
    }
  }
  material.dispose();
}

Reference Links

Official Sources

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Threejs Syntax Loaders AI skill do?

Use when loading 3D models (GLTF, FBX, OBJ), textures, or HDR environment maps in Three.js. Prevents the common mistake of not setting up DRACOLoader, wrong WASM path, or missing error handling. Covers GLTFLoader, DRACOLoader, KTX2Loader, TextureLoader, RGBELoader, FBXLoader, OBJLoader, LoadingManager. Keywords: GLTFLoader, GLTF, GLB, load model, DRACOLoader, texture, FBXLoader, OBJLoader, RGBELoader, HDR, LoadingManager, progress, export, GLTFExporter, save model, download 3D, import 3D file.

Why use Threejs Syntax Loaders on TypingMind?

Because you install it once and use it with any model. Threejs Syntax Loaders is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Threejs Syntax Loaders in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Impertio-Studio/Three.js-Claude-Skill-Package/tree/master/skills/source/threejs-syntax/threejs-syntax-loaders. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Threejs Syntax Loaders?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Threejs Syntax Loaders?

As many as you like. As long as a model supports skills, you can use Threejs Syntax Loaders with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Threejs Syntax Loaders AI skill free?

Yes. It is published on GitHub by Impertio-Studio under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇