使い方
- インストールコマンドをコピーし、自分の環境へ導入する前にソースを確認します。
- 必要なツール、認証情報、対応環境を原文で確認します。
- 入力と成果物を指定し、出力を資料と照合します。
npx skills add https://github.com/full-stack-skills/threejs-skills --skill threejs-textures開始前の確認
- 導入にはモデル契約、API枠、ファイルへのアクセス許可は含まれません。
- スター数や導入数は活動の指標であり、独立した品質・安全性試験ではありません。
見出し、例、コード、表、リンク、参照画像を含む原文を表示しています。
When to use this skill
ALWAYS use this skill when the user mentions:
texture.wrapS/wrapT,minFilter,magFilter,generateMipmaps,anisotropycolorSpace/ correct handling of sRGB vs linear data maps- Creating
DataTexture,CubeTexture, compressed GPU formats, video/canvas driven textures PMREMGeneratorfrom 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
colorSpaceappropriately; normal/roughness maps are non-color data. - Sampling: choose filters; enable mipmaps when minification occurs; consider max anisotropy.
- PMREM: feed env map through
PMREMGeneratorper 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)
| 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).
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, orPMREMGeneratoras 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
- https://threejs.org/docs/#Textures
- https://threejs.org/docs/Texture.html
- https://threejs.org/docs/PMREMGenerator.html
Keywords
English: texture, cubemap, pmrem, mipmap, colorspace, compressed texture, data texture, three.js
中文: 纹理、立方体贴图、PMREM、mipmap、色彩空间、压缩纹理、three.js