threejs-textures
$
npx mdskill add partme-ai/full-stack-skills/threejs-texturesConfigures GPU texture objects and PMREM in three.js, handling sampling parameters, color spaces, and environment map prefiltering.
- Helps with setting up texture properties like filters, mipmaps, and anisotropy for optimal rendering.
- Integrates with three.js for texture classes and PMREMGenerator, and references other skills for loaders and materials.
- Decides recommendations by classifying texture types and analyzing user queries for specific parameters or tasks.
- Presents results by providing configuration guidance and referencing related skills for a complete workflow.
SKILL.md
.github/skills/threejs-texturesView on GitHub ↗
--- name: threejs-textures description: "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." --- ## 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 1. **Classify** texture dimensionality and format (2D, cube, depth, compressed, data). 2. **Color pipeline**: set `colorSpace` appropriately; normal/roughness maps are non-color data. 3. **Sampling**: choose filters; enable mipmaps when minification occurs; consider max anisotropy. 4. **PMREM**: feed env map through `PMREMGenerator` per docs; assign result to scene/env/intensity paths as required. 5. **Video/canvas**: understand update needs each frame for `VideoTexture` / `CanvasTexture`. 6. **Disposal**: `dispose()` textures when replacing to free GPU memory. 7. **KTX2/Basis**: transcoder wiring belongs in **threejs-loaders** before this step. See [examples/workflow-pmrem-env.md](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](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. ## Agent response checklist When answering under this skill, prefer responses that: 1. Link `Texture`, `DataTexture`, `CubeTexture`, or `PMREMGenerator` as appropriate. 2. Tie `colorSpace` / filtering to **threejs-renderers** output and **threejs-materials** maps. 3. Send Draco/KTX2 **decoder wiring** questions to **threejs-loaders** first. 4. Emphasize `dispose()` when replacing env maps or large atlases. 5. Mention [Global](https://threejs.org/docs/#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
More from partme-ai/full-stack-skills
- adobe-xd"Guides creation of UI/UX designs, interactive prototypes, reusable components, and design specs in Adobe XD. Use when the user asks about Adobe XD artboards, prototype links, repeat grids, component states, design tokens export, or developer handoff."
- angular"Provides comprehensive guidance for Angular framework including components, modules, services, dependency injection, routing, forms, and TypeScript integration. Use when the user asks about Angular, needs to create Angular applications, implement Angular components, or work with Angular features."
- ansible"Provides comprehensive guidance for Ansible automation including playbooks, roles, inventory, and module usage. Use when the user asks about Ansible, needs to automate IT tasks, create Ansible playbooks, or manage infrastructure with Ansible."
- ant-design-mini"Builds mini-program UIs with Ant Design Mini components for Alipay and WeChat mini-programs. Covers Button, Form, List, Modal, Tabs, NavBar, and 60+ components with theme customization and CSS variable theming. Use when the user needs to create mini-program interfaces with Ant Design Mini, configure themes, or implement mini-program-specific UI patterns."
- ant-design-mobile"Builds React mobile UIs with Ant Design Mobile (antd-mobile) components including Button, Form, List, Modal, Picker, Tabs, PullToRefresh, InfiniteScroll, and 50+ mobile-optimized components. Use when the user needs to create mobile-first React interfaces, implement mobile navigation, forms, or data display with Ant Design Mobile."
- ant-design-react"Builds enterprise React UIs with Ant Design (antd) including 60+ components (Button, Form, Table, Select, Modal, Message), design tokens, TypeScript support, and ConfigProvider theming. Use when the user needs to create React applications with Ant Design, build forms with validation, display data tables, or customize the Ant Design theme."
- ant-design-vueProvides comprehensive guidance for Ant Design Vue (AntDV) component library for Vue 3. Covers installation, usage, API reference, templates, and all component categories. Use when building enterprise-class UI with Vue 3 and Ant Design.
- api-doc-generator"Generate API documentation by scanning Controller classes, extracting endpoint URLs, HTTP methods, parameters, and response structures, then producing standardized docs from templates. Use when the user explicitly mentions generating API documentation, creating API docs, scanning interfaces, or documenting REST APIs. Do not trigger for generic documentation requests without explicit API mention."
- appium"Provides comprehensive guidance for Appium mobile testing including mobile app automation, element location, gestures, and cross-platform testing. Use when the user asks about Appium, needs to test mobile applications, automate mobile apps, or write Appium test scripts."
- ascii-ansi-colorizer"Add an ANSI color layer to existing ASCII/plain-text output (gradient/rainbow/highlights) with alignment-safe rules and a required no-color fallback. Use when the user wants to colorize terminal output, add rainbow effects to CLI text, or style ASCII art with ANSI colors."