threejs-loaders covers bringing assets into a three.js scene. Its quick start loads a glTF model with GLTFLoader and lights it with a RoomEnvironment, and notes that glTF PBR materials render black without lights or an environment.
Further sections cover the LoadingManager for combined progress, glTF with Draco, meshopt and KTX2 compression, other model formats, HDR and EXR environment maps, caching, cloning and disposal.
What You Get
- A quick start that loads a glTF model and lights it with a generated room environment
- LoadingManager patterns for start, progress, load and error events
- Setup notes for glTF files compressed with Draco, meshopt and KTX2
- Coverage of other model formats and HDR and EXR environment maps
- Guidance on caching, cloning and disposing of loaded assets
Common Use Cases
- Loading a glTF model into a scene
- Showing a loading progress bar for several assets
- Using an HDR file as scene lighting and background
- Cloning a loaded model for several instances
- Freeing GPU memory when a model is removed
What Makes It Unique
It points out why a freshly loaded glTF looks black and supplies the environment fix in the first example. It is the loading half of a pair with the asset pipeline skill, which compresses files that this skill then loads. It is pinned to r186 and cross-linked to its siblings.
Under The Hood
The skill is a single SKILL.md of explanation and JavaScript examples, with no scripts, and it tells the agent to run no commands. The agent reads it and writes three.js code into your project. The example code makes network requests in the browser to load model and texture files, including one fetch call, when the page runs. The skill itself does not make requests and writes no files.