Capítulo 222 de 859

Chapter 222: DataArrayTexture

Core Idea

Creates an array of textures directly from raw buffer data.

Key Concepts

  • flipY : boolean: If set to true, the texture is flipped along the vertical axis when uploaded to the GPU.
  • generateMipmaps : boolean: Whether to generate mipmaps (if possible) for a texture.
  • image : Object: The image definition of a data texture.
  • isDataArrayTexture : boolean (readonly): This flag can be used for type testing.
  • layerUpdates : Set.<number>: A set of all layers which need to be updated in the texture.
  • magFilter : NearestFilter | NearestMipmapNearestFilter | NearestMipmapLinearFilter | LinearFilter | LinearMipmapNearestFilter | LinearMipmapLinearFilter: How the texture is sampled when a texel covers more than one pixel.
  • minFilter : NearestFilter | NearestMipmapNearestFilter | NearestMipmapLinearFilter | LinearFilter | LinearMipmapNearestFilter | LinearMipmapLinearFilter: How the texture is sampled when a texel covers less than one pixel.
  • unpackAlignment : boolean: Specifies the alignment requirements for the start of each pixel row in memory.
  • wrapR : RepeatWrapping | ClampToEdgeWrapping | MirroredRepeatWrapping: This defines how the texture is wrapped in the depth and corresponds to W in UVW mapping.

Reference Tables

Constructor

Signature
new DataArrayTexture( data : TypedArray, width : number, height : number, depth : number )

Properties

PropertyDescription
.flipY : booleanIf set to true, the texture is flipped along the vertical axis when uploaded to the GPU.
.generateMipmaps : booleanWhether to generate mipmaps (if possible) for a texture.
.image : ObjectThe image definition of a data texture.
.isDataArrayTexture : boolean (readonly)This flag can be used for type testing.
.layerUpdates : Set.<number>A set of all layers which need to be updated in the texture.
`.magFilter : NearestFilterNearestMipmapNearestFilter
`.minFilter : NearestFilterNearestMipmapNearestFilter
.unpackAlignment : booleanSpecifies the alignment requirements for the start of each pixel row in memory.
`.wrapR : RepeatWrappingClampToEdgeWrapping

Methods

MethodDescription
.addLayerUpdate( layerIndex : number )Describes that a specific layer of the texture needs to be updated. Normally when Texture#needsUpdate is set to true, the entire data texture array is sent to the GPU. M…
.clearLayerUpdates()Resets the layer updates registry.

Key Takeaways

  1. DataArrayTexture extends: EventDispatcher → Texture
  2. Most relevant properties: flipY, generateMipmaps, image, isDataArrayTexture.
  3. Key methods: addLayerUpdate, clearLayerUpdates.

Connects To