Community이미지github.com

cloudai-x/threejs-loaders

Three.js 자산 로딩 - GLTF, 텍스처, 이미지, 모델, 비동기 패턴. 3D 모델, 텍스처, HDR 환경을 로드하거나 로딩 진행 상황을 관리할 때 사용합니다.

threejs-loaders란 무엇인가요?

이 스킬은 Three.js 애플리케이션에서 3D 자산(모델, 텍스처, 이미지, HDR 환경)을 효율적으로 로드하고 관리하는 방법을 제공합니다. 개발자는 GLTFLoader, TextureLoader, RGBELoader 등 다양한 로더를 사용하여 자산을 비동기적으로 불러오고, 로딩 진행 상황을 추적하며, 오류를 처리할 수 있습니다. 주된 사용 사례로는 3D 모델(.glb/.gltf) 로드, 텍스처 및 이미지 로드, HDR 환경 맵 로드, 다중 자산 로딩 진행률 모니터링 등이 있습니다. 이 스킬은 Three.js를 지원하는 모든 환경(웹 브라우저, Node.js 기반 서버 등)에서 사용 가능하며, 기본적인 로딩 패턴과 함께 LoadingManager를 활용한 고급 로딩 관리 기법도 포함합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/cloudai-x/threejs-skills/tree/main/skills/threejs-loaders

Installed? Explore more 이미지 skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

threejs-loaders은(는) 무엇을 하나요?

Three.js 자산 로딩 - GLTF, 텍스처, 이미지, 모델, 비동기 패턴. 3D 모델, 텍스처, HDR 환경을 로드하거나 로딩 진행 상황을 관리할 때 사용합니다.

개요

이 스킬은 Three.js에서 3D 자산(모델, 텍스처, 이미지, HDR 환경)을 로드하는 표준 패턴을 제공합니다.

지원 로더

  • GLTFLoader: .glb/.gltf 3D 모델 로드
  • TextureLoader: 일반 텍스처 이미지 로드
  • CubeTextureLoader: 큐브 맵 텍스처 로드
  • RGBELoader: HDR 환경 맵 로드 (.hdr)
  • FileLoader: 일반 파일(JSON, 바이너리 등) 로드

기본 사용법

GLTF 모델 로드

import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';

const loader = new GLTFLoader();
loader.load(
  'path/to/model.glb',
  (gltf) => {
    scene.add(gltf.scene);
  },
  (xhr) => {
    console.log(`Loading: ${(xhr.loaded / xhr.total) * 100}%`);
  },
  (error) => {
    console.error('An error happened', error);
  }
);

텍스처 로드

import { TextureLoader } from 'three';

const textureLoader = new TextureLoader();
const texture = textureLoader.load('path/to/texture.jpg');
const material = new THREE.MeshStandardMaterial({ map: texture });

HDR 환경 맵 로드

import { RGBELoader } from 'three/examples/jsm/loaders/RGBELoader.js';

const rgbeLoader = new RGBELoader();
rgbeLoader.load('path/to/environment.hdr', (texture) => {
  texture.mapping = THREE.EquirectangularReflectionMapping;
  scene.environment = texture;
});

고급: 로딩 진행 관리

LoadingManager를 사용하여 여러 자산 로드의 진행 상황을 중앙에서 관리할 수 있습니다.

import { LoadingManager } from 'three';
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';

const manager = new LoadingManager();
const gltfLoader = new GLTFLoader(manager);

manager.onStart = (url, itemsLoaded, itemsTotal) => {
  console.log(`Started loading file: ${url}.`);
};
manager.onProgress = (url, itemsLoaded, itemsTotal) => {
  console.log(`Loading file: ${url}. Loaded ${itemsLoaded} of ${itemsTotal} files.`);
};
manager.onLoad = () => {
  console.log('All files loaded.');
};
manager.onError = (url) => {
  console.log(`Error loading ${url}.`);
};

gltfLoader.load('model1.glb', (gltf) => { scene.add(gltf.scene); });
gltfLoader.load('model2.glb', (gltf) => { scene.add(gltf.scene); });

환경 변수

없음

참고

  • 모든 로더는 비동기적으로 동작합니다.
  • 오류 처리를 항상 포함해야 합니다 (onError 콜백 또는 try/catch).
  • 성능을 위해 로드된 자산은 재사용하는 것이 좋습니다.

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

cloudai-x/threejs-animation

Three.js animation - keyframe animation, skeletal animation, morph targets, animation mixing. Use when animating objects, playing GLTF animations, creating procedural motion, or blending animations.

cloudai-x/threejs-fundamentals

Three.js scene setup, cameras, renderer, Object3D hierarchy, coordinate systems. Use when setting up 3D scenes, creating cameras, configuring renderers, managing object hierarchies, or working with transforms.

cloudai-x/threejs-geometry

Three.js geometry creation - built-in shapes, BufferGeometry, custom geometry, instancing. Use when creating 3D shapes, working with vertices, building custom meshes, or optimizing with instanced rendering.

cloudai-x/threejs-interaction

Three.js interaction - raycasting, controls, mouse/touch input, object selection. Use when handling user input, implementing click detection, adding camera controls, or creating interactive 3D experiences.

cloudai-x/threejs-lighting

Three.js lighting - light types, shadows, environment lighting. Use when adding lights, configuring shadows, setting up IBL, or optimizing lighting performance.

cloudai-x/threejs-materials

Three.js materials - PBR, basic, phong, shader materials, material properties. Use when styling meshes, working with textures, creating custom shaders, or optimizing material performance.

cloudai-x/threejs-postprocessing

Three.js post-processing - EffectComposer, bloom, DOF, screen effects. Use when adding visual effects, color grading, blur, glow, or creating custom screen-space shaders.

cloudai-x/threejs-shaders

Three.js shaders - GLSL, ShaderMaterial, uniforms, custom effects. Use when creating custom visual effects, modifying vertices, writing fragment shaders, or extending built-in materials.

cloudai-x/threejs-textures

Three.js textures - texture types, UV mapping, environment maps, texture settings. Use when working with images, UV coordinates, cubemaps, HDR environments, or texture optimization.

관련 스킬