threejs-textures

Configure and manage Three.js textures including UV mapping, environment maps, and render targets.

Updated Jul 16, 2026
One-click install
npx skills add https://github.com/X-manist/Cohmira --skill threejs-textures-x-manist
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-textures
Source: https://github.com/X-manist/Cohmira/tree/main/src/builtin-plugins/openmontage/.agents/skills/threejs-textures
Command: npx skills add https://github.com/X-manist/Cohmira --skill threejs-textures-x-manist

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires three.

What problem does it solve? Working with textures in Three.js involves many subtle details—color spaces, wrapping modes, mipmaps, UV channels, and HDR environment maps—that are easy to get wrong and cause washed-out colors, blurry surfaces, or memory leaks. This Skill provides correct, ready-to-use patterns for every common texture task. ## Core Features & Use Cases - Texture Loading & Configuration: Load images with TextureLoader, set sRGB color space for color maps, configure wrapping, repeat, offset, rotation, filtering, and anisotropy. - Specialized Texture Types: Create DataTexture, CanvasTexture, VideoTexture, compressed KTX2 textures, cube textures, and HDR/EXR environment maps with PMREM generation. - Advanced Techniques: Render-to-texture with WebGLRenderTarget, dynamic reflections with CubeCamera, texture atlases, second UV channels for AO maps, and full PBR material texture sets. - Use Case: When building a 3D product viewer, use this Skill to correctly load a PBR texture set (color, normal, roughness, metalness, AO), apply an HDR environment map for realistic lighting, and dispose of textures properly to avoid GPU memory leaks. ## Quick Start Ask the AI to load a color texture with correct sRGB color space and apply it to a MeshStandardMaterial in your Three.js scene.

Frequently Asked Questions about threejs-textures

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I load and apply a texture in Three.js?

Use THREE.TextureLoader to load an image file, then assign the returned texture to a material property like map on MeshStandardMaterial. For color textures, set texture.colorSpace to THREE.SRGBColorSpace for accurate color reproduction.

How to add an HDR environment map in Three.js?

Load the .hdr file with RGBELoader, then either set texture.mapping to EquirectangularReflectionMapping and assign it to scene.environment, or use PMREMGenerator to prefilter it. The environment map then provides image-based lighting for PBR materials.

Why do my Three.js textures look washed out or too bright?

This usually happens when color textures are not marked as sRGB. Set colorSpace to THREE.SRGBColorSpace on color, albedo, and emissive maps, but leave data textures like normal, roughness, and metalness maps at the default NoColorSpace.

Does Three.js support compressed texture formats?

Yes, Three.js supports KTX2/Basis compressed textures through the KTX2Loader. You must set the transcoder path and call detectSupport with your renderer before loading .ktx2 files, which reduces GPU memory and download size.

Why does my aoMap not work in Three.js?

Ambient occlusion maps require a second UV channel. Copy the existing UV attribute with geometry.setAttribute('uv2', geometry.attributes.uv) so the aoMap has coordinates to sample from.

How do I free texture memory in Three.js?

Call texture.dispose() on each texture and material.dispose() on materials when they are no longer needed. You can check current GPU texture count via renderer.info.memory.textures to verify cleanup.