threejs-loaders
$
npx mdskill add partme-ai/full-stack-skills/threejs-loadersLoads and exports 3D assets like models and textures using three.js loaders and exporters for runtime asset I/O.
- Helps with fetching, decoding, and parsing files into three.js objects for use in applications.
- Integrates with three.js LoadingManager, Cache, FileLoader, GLTFLoader, DRACOLoader, KTX2Loader, and various exporters.
- Recommends actions based on user mentions of specific loaders, exporters, or asset formats like glTF or HDR.
- Presents results by providing loaded objects or exported files, with guidance on related skills for further processing.
SKILL.md
.github/skills/threejs-loadersView on GitHub ↗
--- name: threejs-loaders description: "three.js asset I/O using LoadingManager, Cache, FileLoader, image and texture loaders, GLTFLoader with DRACOLoader and KTX2Loader, and common format loaders under Addons; symmetric exporters such as GLTFExporter and texture/buffer exporters. Use when loading or exporting models, HDR, LUT, fonts, or compressed textures; for runtime Texture object parameters after load use threejs-textures; for scene graph placement use threejs-objects." --- ## When to use this skill **ALWAYS use this skill when the user mentions:** - `GLTFLoader`, `DRACOLoader`, `KTX2Loader`, `FBXLoader`, `OBJLoader`, progress and error handling - `LoadingManager` for global progress, `Cache` for HTTP caching control - Export: `GLTFExporter`, `OBJExporter`, HDR/KTX2 export pipelines - IES, UltraHDR, or domain-specific loaders listed under Addons Loaders in docs **IMPORTANT: loaders vs textures** - **threejs-loaders** = fetch/decode/parse files into three objects. - **threejs-textures** = `Texture`/`DataTexture` parameters, sampling, PMREM after you already have image buffers. **IMPORTANT: loaders vs dev-setup** - Import path issues belong to **threejs-dev-setup**; this skill assumes imports resolve. **Trigger phrases include:** - "GLTFLoader", "DRACO", "KTX2", "LoadingManager", "export gltf" - "加载模型", "导出", "进度条" ## How to use this skill 1. **Pick loader** by format; prefer glTF for PBR interchange when possible. 2. **Wire LoadingManager** for multi-asset batches; surface `onStart`/`onLoad`/`onProgress`/`onError`. 3. **glTF + Draco**: instantiate `DRACOLoader`, set decoder path, attach to `GLTFLoader.setDRACOLoader` per current docs. 4. **glTF + KTX2**: configure `KTX2Loader` with transcoder path and connect to `GLTFLoader` when using Basis textures. 5. **Export**: use `GLTFExporter` with options matching round-trip needs; note large scenes and binary vs JSON. 6. **Security**: only load user URLs with validation; mention CORS for cross-origin assets. 7. **After load**: traverse scene for materials/meshes—hand off material tuning to **threejs-materials**. See [examples/workflow-gltf-draco.md](examples/workflow-gltf-draco.md). ## Doc map (official) | Docs section | Representative links | |--------------|----------------------| | Core Loaders | https://threejs.org/docs/LoadingManager.html | | Core Loaders | https://threejs.org/docs/GLTFLoader.html | | Addons Exporters | https://threejs.org/docs/GLTFExporter.html | | Addons Loaders | https://threejs.org/docs/DRACOLoader.html | Extended list: [references/official-sections.md](references/official-sections.md). ## Scope - **In scope:** Loader and exporter classes, manager/cache, format choice, plugin wiring for Draco/KTX2, export basics. - **Out of scope:** Server-side transcoding pipelines; physics or game engine asset tooling outside three docs. ## Common pitfalls and best practices - Draco/KTX2 **decoder paths** must match deployed files; broken paths fail silently until onError surfaces. - Duplicate texture instances after merge—consider `renderer.initTexture` implications when cloning materials. - Exporters may not round-trip custom shaders; document limitations. - Always dispose geometries/materials when replacing loaded scenes to avoid GPU leaks. ## Documentation and version Loader and exporter APIs (especially `GLTFLoader` + `DRACOLoader` / `KTX2Loader` wiring) change between three.js versions. Follow [Loaders](https://threejs.org/docs/#Loaders) and **Addons → Loaders / Exporters** in [three.js docs](https://threejs.org/docs/); decoder WASM paths are deployment-specific, not library-version alone. ## Agent response checklist When answering under this skill, prefer responses that: 1. Link `LoadingManager`, `GLTFLoader`, or the relevant format page on https://threejs.org/docs/. 2. Separate **loading** (this skill) from **texture/material tuning** after decode (**threejs-textures**, **threejs-materials**). 3. Document Draco/KTX2 **decoder path** and CORS when assets fail silently. 4. Mention exporter limitations (custom shaders, extensions) honestly. 5. Encourage `dispose()` when replacing entire loaded scenes. ## References - https://threejs.org/docs/#Loaders - https://threejs.org/docs/LoadingManager.html - https://threejs.org/docs/GLTFLoader.html - https://threejs.org/docs/GLTFExporter.html ## Keywords **English:** gltf, gltfloader, dracoloader, ktx2, loadingmanager, cache, exporter, asset pipeline, three.js **中文:** GLTFLoader、加载器、Draco、KTX2、导出、资源、进度、three.js
More from partme-ai/full-stack-skills
- adobe-xd"Guides creation of UI/UX designs, interactive prototypes, reusable components, and design specs in Adobe XD. Use when the user asks about Adobe XD artboards, prototype links, repeat grids, component states, design tokens export, or developer handoff."
- angular"Provides comprehensive guidance for Angular framework including components, modules, services, dependency injection, routing, forms, and TypeScript integration. Use when the user asks about Angular, needs to create Angular applications, implement Angular components, or work with Angular features."
- ansible"Provides comprehensive guidance for Ansible automation including playbooks, roles, inventory, and module usage. Use when the user asks about Ansible, needs to automate IT tasks, create Ansible playbooks, or manage infrastructure with Ansible."
- ant-design-mini"Builds mini-program UIs with Ant Design Mini components for Alipay and WeChat mini-programs. Covers Button, Form, List, Modal, Tabs, NavBar, and 60+ components with theme customization and CSS variable theming. Use when the user needs to create mini-program interfaces with Ant Design Mini, configure themes, or implement mini-program-specific UI patterns."
- ant-design-mobile"Builds React mobile UIs with Ant Design Mobile (antd-mobile) components including Button, Form, List, Modal, Picker, Tabs, PullToRefresh, InfiniteScroll, and 50+ mobile-optimized components. Use when the user needs to create mobile-first React interfaces, implement mobile navigation, forms, or data display with Ant Design Mobile."
- ant-design-react"Builds enterprise React UIs with Ant Design (antd) including 60+ components (Button, Form, Table, Select, Modal, Message), design tokens, TypeScript support, and ConfigProvider theming. Use when the user needs to create React applications with Ant Design, build forms with validation, display data tables, or customize the Ant Design theme."
- ant-design-vueProvides comprehensive guidance for Ant Design Vue (AntDV) component library for Vue 3. Covers installation, usage, API reference, templates, and all component categories. Use when building enterprise-class UI with Vue 3 and Ant Design.
- api-doc-generator"Generate API documentation by scanning Controller classes, extracting endpoint URLs, HTTP methods, parameters, and response structures, then producing standardized docs from templates. Use when the user explicitly mentions generating API documentation, creating API docs, scanning interfaces, or documenting REST APIs. Do not trigger for generic documentation requests without explicit API mention."
- appium"Provides comprehensive guidance for Appium mobile testing including mobile app automation, element location, gestures, and cross-platform testing. Use when the user asks about Appium, needs to test mobile applications, automate mobile apps, or write Appium test scripts."
- ascii-ansi-colorizer"Add an ANSI color layer to existing ASCII/plain-text output (gradient/rainbow/highlights) with alignment-safe rules and a required no-color fallback. Use when the user wants to colorize terminal output, add rainbow effects to CLI text, or style ASCII art with ANSI colors."