When to use this skill
ALWAYS use this skill when the user mentions:
texture.wrapS / wrapT, minFilter, magFilter, generateMipmaps, anisotropy
colorSpace / correct handling of sRGB vs linear data maps
- Creating
DataTexture, CubeTexture, compressed GPU formats, video/canvas driven textures
PMREMGenerator from environment maps for IBL
IMPORTANT: textures vs loaders
| Step |
Skill |
| Decode file / HTTP |
threejs-loaders |
Configure GPU Texture |
threejs-textures |
Trigger phrases include:
- "Texture", "CubeTexture", "PMREM", "colorSpace", "mipmap", "各向异性"
- "环境贴图", "数据纹理", "压缩纹理"
How to use this skill
- Classify texture dimensionality and format (2D, cube, depth, compressed, data).
- Color pipeline: set
colorSpace appropriately; normal/roughness maps are non-color data.
- Sampling: choose filters; enable mipmaps when minification occurs; consider max anisotropy.
- PMREM: feed env map through
PMREMGenerator per docs; assign result to scene/env/intensity paths as required.
- Video/canvas: understand update needs each frame for
VideoTexture / CanvasTexture.
- Disposal:
dispose() textures when replacing to free GPU memory.
- KTX2/Basis: transcoder wiring belongs in threejs-loaders before this step.
See examples/workflow-pmrem-env.md.
Doc map (official)
Scope
- In scope: Core Textures + PMREMGenerator; sampling and color pipeline at texture level.
- Out of scope: Loader configuration; post-processing passes that sample buffers (threejs-postprocessing).
Common pitfalls and best practices
- sRGB albedo in linear workflow without proper colorSpace looks wrong next to renderer output.
- Non-power-of-two textures have mip/wrap limitations unless padded.
- Forgetting texture disposal on hot reload leaks VRAM.
Documentation and version
Texture classes and PMREMGenerator are documented under Textures and PMREMGenerator in three.js docs. Compressed and KTX2 paths often depend on threejs-loaders for transcoder setup before this skill applies.
Agent response checklist
When answering under this skill, prefer responses that:
- Link
Texture, DataTexture, CubeTexture, or PMREMGenerator as appropriate.
- Tie
colorSpace / filtering to threejs-renderers output and threejs-materials maps.
- Send Draco/KTX2 decoder wiring questions to threejs-loaders first.
- Emphasize
dispose() when replacing env maps or large atlases.
- Mention Global constants only when wrapping/filter enums matter.
References
Keywords
English: texture, cubemap, pmrem, mipmap, colorspace, compressed texture, data texture, three.js
中文: 纹理、立方体贴图、PMREM、mipmap、色彩空间、压缩纹理、three.js
能力边界
✅ 适用场景
- 当你需要使用此技能对应的技术栈时
- 当项目需要遵循最佳实践时
- 当需要快速上手或深入理解核心概念时
⚠️ 需要注意
- 复杂业务逻辑需要结合具体场景调整
- 性能优化需要根据实际数据量评估
❌ 不适用场景
常见陷阱 (Gotchas)
- 版本兼容性:注意框架版本与依赖库的兼容性,不同版本 API 可能有差异
- 配置文件格式:配置文件格式错误是最常见的问题,建议使用编辑器的语法检查
- 环境变量:确保所有必要的环境变量已正确设置,敏感信息不要硬编码
- 依赖冲突:多版本共存时注意依赖冲突,使用 lock 文件锁定版本
- 性能陷阱:大数据量场景下注意性能优化,避免 N+1 查询等常见问题
使用流程
Step 1: 环境准备
确保开发环境已安装必要的依赖和工具。
Step 2: 配置初始化
根据项目需求进行基础配置。
Step 3: 核心功能使用
按照示例代码实现核心功能。
Step 4: 测试验证
运行测试确保功能正常。
Step 5: 部署上线
完成开发后进行部署和监控。
1---2name: threejs-textures3description: three.js textures: Texture, DataTexture, CubeTexture, CompressedTexture variants, DepthTexture, VideoTexture, CanvasTexture, 3D/array textures, Source; sampling parameters, mipmaps, anisotropy, wrap/mag/min filters; PMREMGenerator in Extras for environment map prefiltering. Use when configuring GPU texture objects and PMREM; for Draco/KTX2 transcoder file paths use threejs-loaders; for material map slots use threejs-materials; for output color pipeline use threejs-renderers.4---56## When to use this skill78**ALWAYS use this skill when the user mentions:**910- `texture.wrapS` / `wrapT`, `minFilter`, `magFilter`, `generateMipmaps`, `anisotropy`11- `colorSpace` / correct handling of sRGB vs linear data maps12- Creating `DataTexture`, `CubeTexture`, compressed GPU formats, video/canvas driven textures13- `PMREMGenerator` from environment maps for IBL1415**IMPORTANT: textures vs loaders**1617| Step | Skill |18|------|--------|19| Decode file / HTTP | **threejs-loaders** |20| Configure GPU `Texture` | **threejs-textures** |2122**Trigger phrases include:**2324- "Texture", "CubeTexture", "PMREM", "colorSpace", "mipmap", "各向异性"25- "环境贴图", "数据纹理", "压缩纹理"2627## How to use this skill28291. **Classify** texture dimensionality and format (2D, cube, depth, compressed, data).302. **Color pipeline**: set `colorSpace` appropriately; normal/roughness maps are non-color data.313. **Sampling**: choose filters; enable mipmaps when minification occurs; consider max anisotropy.324. **PMREM**: feed env map through `PMREMGenerator` per docs; assign result to scene/env/intensity paths as required.335. **Video/canvas**: understand update needs each frame for `VideoTexture` / `CanvasTexture`.346. **Disposal**: `dispose()` textures when replacing to free GPU memory.357. **KTX2/Basis**: transcoder wiring belongs in **threejs-loaders** before this step.3637See [examples/workflow-pmrem-env.md](examples/workflow-pmrem-env.md).3839## Doc map (official)4041| Docs section | Representative links |42|--------------|----------------------|43| Textures | https://threejs.org/docs/Texture.html |44| Cube | https://threejs.org/docs/CubeTexture.html |45| Data | https://threejs.org/docs/DataTexture.html |46| PMREM | https://threejs.org/docs/PMREMGenerator.html |4748## Scope4950- **In scope:** Core Textures + PMREMGenerator; sampling and color pipeline at texture level.51- **Out of scope:** Loader configuration; post-processing passes that sample buffers (threejs-postprocessing).5253## Common pitfalls and best practices5455- sRGB albedo in linear workflow without proper colorSpace looks wrong next to renderer output.56- Non-power-of-two textures have mip/wrap limitations unless padded.57- Forgetting texture disposal on hot reload leaks VRAM.5859## Documentation and version6061Texture classes and `PMREMGenerator` are documented under [Textures](https://threejs.org/docs/#Textures) and [PMREMGenerator](https://threejs.org/docs/PMREMGenerator.html) in [three.js docs](https://threejs.org/docs/). Compressed and KTX2 paths often depend on **threejs-loaders** for transcoder setup before this skill applies.6263## Agent response checklist6465When answering under this skill, prefer responses that:66671. Link `Texture`, `DataTexture`, `CubeTexture`, or `PMREMGenerator` as appropriate.682. Tie `colorSpace` / filtering to **threejs-renderers** output and **threejs-materials** maps.693. Send Draco/KTX2 **decoder wiring** questions to **threejs-loaders** first.704. Emphasize `dispose()` when replacing env maps or large atlases.715. Mention [Global](https://threejs.org/docs/#Global) constants only when wrapping/filter enums matter.7273## References7475- https://threejs.org/docs/#Textures76- https://threejs.org/docs/Texture.html77- https://threejs.org/docs/PMREMGenerator.html7879## Keywords8081**English:** texture, cubemap, pmrem, mipmap, colorspace, compressed texture, data texture, three.js8283**中文:** 纹理、立方体贴图、PMREM、mipmap、色彩空间、压缩纹理、three.js8485## 能力边界8687### ✅ 适用场景88- 当你需要使用此技能对应的技术栈时89- 当项目需要遵循最佳实践时90- 当需要快速上手或深入理解核心概念时9192### ⚠️ 需要注意93- 复杂业务逻辑需要结合具体场景调整94- 性能优化需要根据实际数据量评估9596### ❌ 不适用场景97- 不相关的技术栈或框架98- 需要完全自定义的特殊场景99100## 常见陷阱 (Gotchas)1011021. **版本兼容性**:注意框架版本与依赖库的兼容性,不同版本 API 可能有差异1032. **配置文件格式**:配置文件格式错误是最常见的问题,建议使用编辑器的语法检查1043. **环境变量**:确保所有必要的环境变量已正确设置,敏感信息不要硬编码1054. **依赖冲突**:多版本共存时注意依赖冲突,使用 lock 文件锁定版本1065. **性能陷阱**:大数据量场景下注意性能优化,避免 N+1 查询等常见问题107108## 使用流程109110### Step 1: 环境准备111确保开发环境已安装必要的依赖和工具。112113### Step 2: 配置初始化114根据项目需求进行基础配置。115116### Step 3: 核心功能使用117按照示例代码实现核心功能。118119### Step 4: 测试验证120运行测试确保功能正常。121122### Step 5: 部署上线123完成开发后进行部署和监控。