Tooluck logoTooluck
SKILL.md

threejs-textures

Agent skill fromCloudAI-X/threejs-skills

Three.js textures: image loading, color spaces, UV channels and transforms, texture types from canvas to HDR and KTX2, render targets, texture memory. Use when working with images on materials, UV coordinates, cubemaps, render targets or texture optimization; on WebGL or with WebGPU and TSL.

How to install threejs-textures

install threejs-textures
# install the threejs-skills pack with the skills CLI
npx skills add CloudAI-X/threejs-skills

# or add only this skill to Claude Code: copy the folder

skills/threejs-textures/

# into

~/.claude/skills/threejs-textures/ (all projects)

.claude/skills/threejs-textures/ (one project)

skills/threejs-textures/SKILL.md

MITFull file
1# Three.js Textures
2
3Targets three.js r186. Examples use WebGLRenderer; the WebGPU and TSL section uses WebGPURenderer.
4
5## Quick Start
6
7```javascript
8import * as THREE from "three";
9
10const renderer = new THREE.WebGLRenderer({ antialias: true });
11renderer.setPixelRatio(window.devicePixelRatio);
12renderer.setSize(window.innerWidth, window.innerHeight);
13document.body.appendChild(renderer.domElement);
14
15const scene = new THREE.Scene();
16const camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 100);
17camera.position.set(0, 0, 2);
18
19// Color images must be tagged sRGB or they render too bright and washed out
20const texture = new THREE.TextureLoader().load("diffuse.jpg");
21texture.colorSpace = THREE.SRGBColorSpace;
22
23const mesh = new THREE.Mesh(
24 new THREE.PlaneGeometry(2, 2),
25 new THREE.MeshBasicMaterial({ map: texture }),
26);
27scene.add(mesh);
28
29renderer.setAnimationLoop(animate);
30
31function animate() {
32 mesh.rotation.z += 0.01;
33 renderer.render(scene, camera);
34}
35```
36
37## Loading
38
39```javascript
40// load() returns the texture at once; its image arrives asynchronously
41const texture = new THREE.TextureLoader().load("diffuse.jpg");
42texture.colorSpace = THREE.SRGBColorSpace;
43mesh.material.map = texture; // before the first render; afterwards also set mesh.material.needsUpdate = true
44
45// When the next step needs the loaded image, await it
46const colorMap = await new THREE.TextureLoader().loadAsync("diffuse.jpg");
47colorMap.colorSpace = THREE.SRGBColorSpace;
48```
49…

Excerpt shown under the repository's MIT license.

More skills in threejs-skills

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Leonxlnx /

taste-skill
113k

Agent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages

CCCXCU1 skill

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates