Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

threejs-textures

/threejs-textures

Ładuje i optymalizuje tekstury Three.js: przestrzeń kolorów, zawijanie, filtrowanie, mipmapy, mapy PBR, HDR i pamięć GPU.

Repozytorium
jeo-skills ↗
Licencja
MIT
Ostatnia zmiana repozytorium
13.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
3
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
4
Przestarzałość

Brak sygnałów. Repozytorium zmienione 13.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Ładuje i optymalizuje tekstury Three.js: przestrzeń kolorów, zawijanie, filtrowanie, mipmapy, mapy PBR, HDR i pamięć GPU.

Oryginalny opis (EN)

Load, configure, and optimize Three.js textures: color space, wrapping, filtering, mipmaps, UV transforms, normal/AO/PBR maps, cube and HDR environments, data/canvas/video textures, render targets, texture memory, and disposal. Use when images look wrong, UVs repeat incorrectly, HDR/IBL is needed, or texture quality and GPU memory need tuning. Triggers on: Three.js texture, TextureLoader, UV mapping, color space, sRGB, mipmap, anisotropy, normal map, environment map, cubemap, HDR texture, render target, video texture.

Jak działa

  1. When to use this skill
  2. Instructions
  3. Examples
  4. Best practices
  5. References
Sekcje z nagłówków SKILL.md, w oryginale · 103 linii, 606 słów
Podgląd SKILL.md
---
name: threejs-textures
description: >
  Load, configure, and optimize Three.js textures: color space, wrapping, filtering,
  mipmaps, UV transforms, normal/AO/PBR maps, cube and HDR environments, data/canvas/video
  textures, render targets, texture memory, and disposal. Use when images look wrong,
  UVs repeat incorrectly, HDR/IBL is needed, or texture quality and GPU memory need tuning.
  Triggers on: Three.js texture, TextureLoader, UV mapping, color space, sRGB, mipmap,
  anisotropy, normal map, environment map, cubemap, HDR texture, render target, video texture.
allowed-tools: Bash Read Write Edit Glob Grep
license: MIT
metadata:
  tags: three.js, textures, uv, color-space, hdr, environment-map, render-target, webgl
  version: "1.0"
  source: https://github.com/CloudAI-X/threejs-skills/tree/main/skills/threejs-textures
---

# Three.js Textures

Use this skill for texture assets, UV behavior, color/data interpretation, environment
maps, and GPU texture memory. Route asset transport/decoder setup to `threejs-loaders`,
PBR material semantics to `threejs-materials`, and direct lighting decisions to
`threejs-lighting`.

## When to use this skill

- Load and configure base-color, normal, roughness, metalness, AO, emissive, or alpha maps
- Fix color mismatch, blurry/distant images, seams, bad repeats, incorrect UVs, or missing AO
- Use HDR/cubemap environments, canvas/video/data textures, or render targets
- Reduce texture memory, resolution, sampling, or duplicated GPU allocations

## Instructions

### Step 1: Classify every texture by meaning

1. Identify whether the texture stores visible color or non-color data.
2. Use the renderer/version's documented color-space settings for visible color textures;
   do not apply display color treatment to normal, roughness, metalness, depth, or data maps.
3. Confirm the mesh has the UV channel the material map expects. Ambient occlusion often
   needs a second UV set depending on the material and asset pipeline.

```js
const baseColor = await new THREE.TextureLoader().loadAsync("/textures/albedo.jpg");
baseColor.colorSpace = THREE.SRGBColorSpace;
baseColor.wrapS = THREE.RepeatWrapping;
baseColor.wrapT = THREE.RepeatWrapping;
baseColor.repeat.set(2, 2);
```

### Step 2: Choose sampling and wrapping from visual evidence

| Need | Setting direction |
|---|---|
| Tileable map | Repeat/mirrored wrapping and intentional `repeat` |
| Hard pixel-art texture | Nearest filtering, no accidental mip blur |
| Normal 3D asset | Mipmaps plus appropriate min/mag filtering |
| Oblique surface detail | Anisotropy within measured device limits |
| Cutout alpha | Correct material alpha policy, not texture filtering alone |
| Dynamic canvas/video | `CanvasTexture` / `VideoTexture` with lifecycle control |

Do not set maximum anisotropy globally by habit. Query hardware capability and use a
quality tier based on actual visual value.

### Step 3: Handle environment and render textures as GPU resources

An HDR/equirectangular texture generally requires the renderer-version-appropriate
preprocessing path before use as a PBR environment. Set `scene.environment` and
`scene.background` separately according to the intended effect. A render target's texture
is produced by a render pass and must be resized/disposed with that pass.

### Step 4: Budget memory and ownership

Texture memory scales with dimensions, mip levels, format, and copies—not only file size.
Reuse immutable texture instances, avoid loading the same URL through multiple owners, and
release feature-owned textures/render targets when their last user unmounts.

```js
function disposeTexture(texture) {
  texture?.dispose();
}
```

Do not dispose a texture held by another material or shared asset cache.

### Step 5: Verify visual correctness and lifecycle

- Test base-color, normal, roughness, metalness, AO, and emissive maps under representative
  lights and color management.
- Inspect UV seams and repeat orientation on the actual mesh.
- Test the target device/profile for memory pressure and frame-time behavior.
- Resize render targets, stop/release video resources, and dispose feature-owned GPU textures.

## Examples

### PBR texture set

Wire each map to its semantic material property, set color space only for visible color
maps, and validate the asset's normal-map convention. A flat or inverted normal look is
usually map convention, tangent/UV, or color-data handling—not a roughness issue.

### Dynamic video surface

Create `VideoTexture` from an explicitly owned video element, handle play/pause/error and
cross-origin setup, and dispose the texture plus media resource according to the UI lifecycle.

## Best practices

1. Distinguish display color from numeric data before setting color space.
2. Keep UV channel expectations explicit in the asset pipeline.
3. Use texture dimensions and compression appropriate to the device budget.
4. Reuse shared textures and dispose only when their final consumer is gone.
5. Treat render targets and video/canvas textures as active lifecycle resources.

## References

- [Three.js Textures source coverage](https://github.com/CloudAI-X/threejs-skills/tree/main/skills/threejs-textures)
- [Texture documentation](https://threejs.org/docs/#api/en/textures/Texture)
- [Three.js manual: textures](https://threejs.org/manual/#en/textures)
Pliki w paczce (3)
  • SKILL.md 5 KB
  • SKILL.toon 1 KB
  • evals/evals.json 1 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · akillness/jeo-skills100MIT
cloudai-x/threejs-skills100MIT
full-stack-skills/threejs-skills100Apache-2.0
kumaran-is/claude-code-onboarding100MIT
calesthio/OpenMontage95AGPL-3.0
LiHongwei-cn/lihongwei-cn95MIT
miaoge-ge/coding-agent-skills95MIT

Migawka bazy z 13.11.2026 · wersja paczki d98685ec4b95 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100threejs-syntax-materials
    Wybiera i konfiguruje materiały Three.js oraz przepływ PBR, pilnując przestrzeni kolorów tekstur i zwalniania materiałów.
  • 100threejs-loaders
    Ładuje i eksportuje zasoby Three.js: GLTF z Draco i KTX2, tekstury, HDR, czcionki i formaty z addonów.
  • 95threejs-loaders
    Pomaga ładować zasoby w Three.js: modele GLTF, tekstury, obrazy, środowiska HDR, wzorce asynchroniczne i śledzenie postępu ładowania.
  • 95threejs-loaders
    Pomaga ładować zasoby w Three.js: modele GLTF, tekstury, obrazy, środowiska HDR, wzorce asynchroniczne i śledzenie postępu ładowania.
  • 100threejs-loaders
    Ładuje modele GLTF, tekstury i obrazy w Three.js asynchronicznie i pokazuje postęp wczytywania.
  • 100threejs-loaders
    Ładuje zasoby Three.js: glTF z Draco, meshopt i KTX2, tekstury, mapy HDR i EXR, pokazuje postęp, cache oraz zwalnianie.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.