full-stack-skills/threejs-skills

threejs-textures

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…

查看源码

使用方法

  1. 复制安装命令,在自己的智能体环境安装前先检查源码包。
  2. 从原始文档核对所需工具、凭据和支持的宿主。
  3. 说明输入材料与期望交付物,并对照来源检查输出。
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, 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

StepSkill
Decode file / HTTPthreejs-loaders
Configure GPU Texturethreejs-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.

Doc map (official)

Docs sectionRepresentative links
Textureshttps://threejs.org/docs/Texture.html
Cubehttps://threejs.org/docs/CubeTexture.html
Datahttps://threejs.org/docs/DataTexture.html
PMREMhttps://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:

  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 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

来自同一仓库

更多 Skills

全部 Skills
full-stack-skills
社区

threejs-audio

three.js audio spatialization: AudioListener attached to camera rig, Audio and PositionalAudio sources, AudioAnalyser for FFT/time-domain data, and integration with Web Audio API contexts; AudioLoader is referenced from threejs-loaders for file decoding. Use when placing 3D sound, configuring panner parameters, or visualization; not a replacement for full game audio middleware.

1小时安装量
3
GitHub Stars
14
最近更新
10月3日
full-stack-skills
社区

threejs-camera

three.js cameras: Camera base, PerspectiveCamera, OrthographicCamera, CubeCamera, ArrayCamera, StereoCamera; projection matrices, aspect, FOV, orthographic frustum sizes, near/far planes, and dynamic environment maps with CubeCamera. Use when placing views, rendering reflections, or multi-view splits; for XR projections and eye matrices use threejs-webxr; for post pass camera tricks use threejs-postprocessing alongside threejs-renderers.

1小时安装量
3
GitHub Stars
14
最近更新
10月3日
full-stack-skills
社区

threejs-controls

Addon camera and object manipulation controls: OrbitControls, MapControls, FlyControls, FirstPersonControls, TrackballControls, ArcballControls, DragControls, PointerLockControls, TransformControls; damping, target focal point, and integration with the animation loop. Use for editor-style navigation and gizmos—not a full game character controller stack; pair with Raycaster selection patterns in threejs-objects when transforming selections.

1小时安装量
3
GitHub Stars
14
最近更新
10月3日
full-stack-skills
社区

threejs-dev-setup

Bootstrap and toolchain guidance for three.js applications using npm, Vite/Webpack/Rollup, bare ESM import maps, and TypeScript. Covers canonical import paths for three core versus three/addons/ (examples/jsm re-exports), version alignment with https://threejs.org/docs/, and fixing "module not found" for loaders and controls. Use when scaffolding a new 3D project, migrating bundler, or debugging resolution of addons—do not use for rendering API details (see threejs-renderers) or asset loading lo

1小时安装量
3
GitHub Stars
14
最近更新
10月3日