threejs-textures
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWhen to use this skill
何时使用此技能
ALWAYS use this skill when the user mentions:
- /
texture.wrapS,wrapT,minFilter,magFilter,generateMipmapsanisotropy - / correct handling of sRGB vs linear data maps
colorSpace - Creating ,
DataTexture, compressed GPU formats, video/canvas driven texturesCubeTexture - from environment maps for IBL
PMREMGenerator
IMPORTANT: textures vs loaders
| Step | Skill |
|---|---|
| Decode file / HTTP | threejs-loaders |
Configure GPU | threejs-textures |
Trigger phrases include:
- "Texture", "CubeTexture", "PMREM", "colorSpace", "mipmap", "各向异性"
- "环境贴图", "数据纹理", "压缩纹理"
当用户提到以下内容时,务必使用此技能:
- /
texture.wrapS、wrapT、minFilter、magFilter、generateMipmapsanisotropy - / sRGB 与线性数据贴图的正确处理
colorSpace - 创建 、
DataTexture、压缩 GPU 格式、视频/画布驱动的纹理CubeTexture - 基于环境贴图使用 实现 IBL(基于图像照明)
PMREMGenerator
重要提示:纹理 vs 加载器
| 步骤 | 技能 |
|---|---|
| 解码文件 / HTTP 请求 | threejs-loaders |
配置 GPU | threejs-textures |
触发短语包括:
- "Texture", "CubeTexture", "PMREM", "colorSpace", "mipmap", "各向异性"
- "环境贴图", "数据纹理", "压缩纹理"
How to use this skill
如何使用此技能
- Classify texture dimensionality and format (2D, cube, depth, compressed, data).
- Color pipeline: set appropriately; normal/roughness maps are non-color data.
colorSpace - Sampling: choose filters; enable mipmaps when minification occurs; consider max anisotropy.
- PMREM: feed env map through per docs; assign result to scene/env/intensity paths as required.
PMREMGenerator - Video/canvas: understand update needs each frame for /
VideoTexture.CanvasTexture - Disposal: textures when replacing to free GPU memory.
dispose() - KTX2/Basis: transcoder wiring belongs in threejs-loaders before this step.
See examples/workflow-pmrem-env.md.
- 分类:确定纹理的维度和格式(2D、立方体贴图、深度、压缩、数据)。
- 色彩管线:合理设置 ;法线/粗糙度贴图属于非颜色数据。
colorSpace - 采样:选择滤镜;当发生缩小时启用 mipmap;考虑最大各向异性。
- PMREM:按照文档将环境贴图传入 ;根据需要将结果赋值到 scene/env/intensity 相关路径。
PMREMGenerator - 视频/画布:了解 /
VideoTexture每帧的更新需求。CanvasTexture - 销毁:替换纹理时调用 释放 GPU 内存。
dispose() - KTX2/Basis:转码器的配置属于 threejs-loaders 的范畴,应在此步骤之前完成。
参见 examples/workflow-pmrem-env.md。
Doc map (official)
文档索引(官方)
| Docs section | Representative links |
|---|---|
| Textures | https://threejs.org/docs/Texture.html |
| Cube | https://threejs.org/docs/CubeTexture.html |
| Data | https://threejs.org/docs/DataTexture.html |
| PMREM | https://threejs.org/docs/PMREMGenerator.html |
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).
- 适用范围: 核心纹理 + PMREMGenerator;纹理层面的采样和色彩管线。
- 不适用范围: 加载器配置;对缓冲区进行采样的后处理通道(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.
- 在线性工作流中,sRGB 反照率贴图若未正确设置 ,与渲染器输出搭配时会出现色彩异常。
colorSpace - 非二次幂纹理在 mipmap/环绕模式上存在限制,除非进行填充处理。
- 热重载时忘记销毁纹理会导致 VRAM 泄漏。
Documentation and version
文档与版本
Texture classes and 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.
PMREMGenerator纹理类和 的文档位于 three.js 官方文档 的 纹理 和 PMREMGenerator 板块下。压缩纹理和 KTX2 相关流程通常需要先通过 threejs-loaders 完成转码器配置,之后才能应用此技能。
PMREMGeneratorAgent response checklist
Agent 回复检查清单
When answering under this skill, prefer responses that:
- Link ,
Texture,DataTexture, orCubeTextureas appropriate.PMREMGenerator - Tie / filtering to threejs-renderers output and threejs-materials maps.
colorSpace - Send Draco/KTX2 decoder wiring questions to threejs-loaders first.
- Emphasize when replacing env maps or large atlases.
dispose() - Mention Global constants only when wrapping/filter enums matter.
在此技能范畴内回答问题时,优先遵循以下回复原则:
- 根据情况链接 、
Texture、DataTexture或CubeTexture的文档。PMREMGenerator - 将 / 滤镜与 threejs-renderers 的输出以及 threejs-materials 的贴图关联起来。
colorSpace - 涉及 Draco/KTX2 解码器配置的问题,请优先引导至 threejs-loaders 技能。
- 在替换环境贴图或大型图集时,强调 的使用。
dispose() - 仅在涉及环绕/滤镜枚举值时,提及 Global 常量。
References
参考资料
Keywords
关键词
English: texture, cubemap, pmrem, mipmap, colorspace, compressed texture, data texture, three.js
中文: 纹理、立方体贴图、PMREM、mipmap、色彩空间、压缩纹理、three.js
英文: texture, cubemap, pmrem, mipmap, colorspace, compressed texture, data texture, three.js
中文: 纹理、立方体贴图、PMREM、mipmap、色彩空间、压缩纹理、three.js