New advertisers: 50% off your first month with code FIRSTMONTHSee slots
cloudai-x avatar

Threejs Textures

Three.js texture guide covering loading, color space, UV transforms, filtering, texture types, KTX2 compression, and environment maps.

skills.sh installs
18.2K
GitHub stars
4.3K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers image loading, color spaces, UV wrap, repeat, offset and rotation, filtering, mipmaps, and anisotropy
  • Includes texture types Texture, DataTexture, CanvasTexture, VideoTexture, VideoFrameTexture, and HTMLTexture with setup code
  • Enforces sRGB tagging for color maps while data maps like normal and roughness stay at NoColorSpace
  • Designed for developers working with WebGLRenderer, WebGPURenderer, and TSL on images, cubemaps, and texture memory

Install

$ npx -y skills add cloudai-x/threejs-skills --skill threejs-textures -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Three.js Textures

Targets three.js r186. Examples use WebGLRenderer; the WebGPU and TSL section uses WebGPURenderer.

Quick Start

import * as THREE from "three";

const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);

const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 100);
camera.position.set(0, 0, 2);

// Color images must be tagged sRGB or they render too bright and washed out
const texture = new THREE.TextureLoader().load("diffuse.jpg");
texture.colorSpace = THREE.SRGBColorSpace;

const mesh = new THREE.Mesh(
  new THREE.PlaneGeometry(2, 2),
  new THREE.MeshBasicMaterial({ map: texture }),
);
scene.add(mesh);

renderer.setAnimationLoop(animate);

function animate() {
  mesh.rotation.z += 0.01;
  renderer.render(scene, camera);
}

Loading

Details

Repository
github.com/cloudai-x/threejs-skills
Categories
3D, CAD & Modeling, Frontend & UI Code

More from cloudai-x/threejs-skills

All 10

Similar to Threejs Textures

More 3D, CAD & Modeling