Capítulo 234 de 859

Chapter 234: TextureHelper

Core Idea

A helper that can be used to display any type of texture for debugging purposes. Depending on the type of texture (2D, 3D, Array), the helper becomes a plane or box mesh.

This helper can only be used with WebGLRenderer. When using WebGPURenderer, import from TextureHelperGPU.js.

Key Concepts

  • texture : Texture: The texture to visualize.

Code Examples

import { TextureHelper } from 'three/addons/helpers/TextureHelper.js';
  • What it demonstrates: Typical usage of TextureHelper.

Reference Tables

Constructor

Signature
new TextureHelper( texture : Texture, width : number, height : number, depth : number )

Properties

PropertyDescription
.texture : TextureThe texture to visualize.

Methods

MethodDescription
.dispose()Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.

Key Takeaways

  1. TextureHelper extends: EventDispatcher → Object3D → Mesh
  2. Most relevant properties: texture.
  3. Key methods: dispose.

Connects To