Capítulo 229 de 859

Chapter 229: Storage3DTexture

Core Idea

This special type of texture is intended for compute shaders. It can be used to compute the data of a texture with a compute shader.

Note: This type of texture can only be used with WebGPURenderer and a WebGPU backend.

Key Concepts

  • image : Object: The image object which just represents the texture's dimension.
  • is3DTexture : boolean: Indicates whether this texture is a 3D texture.
  • isStorageTexture : boolean (readonly): This flag can be used for type testing.
  • magFilter : number: The default magFilter for storage textures is THREE.LinearFilter.
  • minFilter : number: The default minFilter for storage textures is THREE.LinearFilter.
  • wrapR : number: This defines how the texture is wrapped in the depth direction and corresponds to W in UVW mapping.

Reference Tables

Constructor

Signature
new Storage3DTexture( width : number, height : number, depth : number )

Properties

PropertyDescription
.image : ObjectThe image object which just represents the texture's dimension.
.is3DTexture : booleanIndicates whether this texture is a 3D texture.
.isStorageTexture : boolean (readonly)This flag can be used for type testing.
.magFilter : numberThe default magFilter for storage textures is THREE.LinearFilter.
.minFilter : numberThe default minFilter for storage textures is THREE.LinearFilter.
.wrapR : numberThis defines how the texture is wrapped in the depth direction and corresponds to W in UVW mapping.

Methods

MethodDescription
.setSize( width : number, height : number, depth : number )Sets the size of the storage 3d texture.

Key Takeaways

  1. Storage3DTexture extends: EventDispatcher → Texture
  2. Most relevant properties: image, is3DTexture, isStorageTexture, magFilter.
  3. Key methods: setSize.

Connects To