t3d. Texture2DArray

Creates a 2d texture. (WebGL 2.0)

Constructor

new Texture2DArray()

Extends

Members

anisotropy :Number

The number of samples taken along the axis through the pixel that has the highest density of texels. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use WebGLcapabilities#maxAnisotropy to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
Type:
  • Number
Default Value
  • 1

border :Number

WebGLTexture border. See WebGLTexture texImage2D(). Must be zero.
Type:
  • Number

compare :t3d.COMPARE_FUNC|Undefined

Use for shadow sampler (WebGL 2.0 Only).
Type:
Default Value
  • undefined

encoding :t3d.TEXEL_ENCODING_TYPE

texture pixel encoding.
Default Value
  • t3d.TEXEL_ENCODING_TYPE.LINEAR

flipY

Default Value
  • false

format

Default Value
  • t3d.PIXEL_FORMAT.RED

generateMipmaps

Default Value
  • false

(readonly) id :Number

Unique number for this texture instance.
Type:
  • Number

image :Object

Image data for this texture.
Type:
  • Object
Default Value
  • null

internalformat :Null|t3d.PIXEL_FORMAT

The default value is null, the texture's internal format will be obtained using a combination of .format and .type. Users can also specify a specific internalFormat.
Type:
Default Value
  • null

(readonly) isTexture :Boolean

Type:
  • Boolean
Default Value
  • true

(readonly) isTexture2DArray :Boolean

Type:
  • Boolean
Default Value
  • true

layerUpdates :Set

A set of all layers which need to be updated in the texture.
Type:
  • Set

magFilter

Default Value
  • t3d.TEXTURE_FILTER.NEAREST

minFilter

Default Value
  • t3d.TEXTURE_FILTER.NEAREST

mipmaps :Array.<HTMLImageElement>|Array.<Object>

Array of user-specified mipmaps (optional).
Type:
  • Array.<HTMLImageElement> | Array.<Object>
Default Value
  • []

premultiplyAlpha :Boolean

If set to true, the alpha channel, if present, is multiplied into the color channels when the texture is uploaded to the GPU. Note that this property has no effect for ImageBitmap. You need to configure on bitmap creation instead.
Type:
  • Boolean
Default Value
  • false

type :t3d.PIXEL_TYPE

WebGLTexture texel data type.
Default Value
  • t3d.PIXEL_TYPE.UNSIGNED_BYTE

unpackAlignment

Default Value
  • 1

version :Number

version code increse if texture changed. if version is still 0, this texture will be skiped.
Type:
  • Number
Default Value
  • 0

wrapS :t3d.TEXTURE_WRAP

This defines how the texture is wrapped horizontally and corresponds to U in UV mapping.
Default Value
  • t3d.TEXTURE_WRAP.CLAMP_TO_EDGE

wrapT :t3d.TEXTURE_WRAP

This defines how the texture is wrapped vertically and corresponds to V in UV mapping.
Default Value
  • t3d.TEXTURE_WRAP.CLAMP_TO_EDGE

Methods

addEventListener(type, listener, thisObjectopt)

Adds a listener to an event type.
Parameters:
NameTypeAttributesDefaultDescription
typeStringThe type of event to listen to.
listenerfunctionThe function that gets called when the event is fired.
thisObjectObject<optional>
thisThe Object of calling listener method.

clone() → {t3d.TextureBase}

Returns a clone of this texture.
Returns:
Type: 
t3d.TextureBase

copy(source) → {t3d.Texture2DArray}

Copy the given 2d texture into this texture.
Parameters:
NameTypeDescription
sourcet3d.Texture2DArrayThe 2d texture to be copied.
Returns:
Type: 
t3d.Texture2DArray

dispatchEvent(event)

Fire an event.
Parameters:
NameTypeDescription
eventObjectThe event that gets fired.

dispose()

Dispatches a dispose event.

removeEventListener(type, listener, thisObjectopt)

Removes a listener from an event type.
Parameters:
NameTypeAttributesDefaultDescription
typeStringThe type of the listener that gets removed.
listenerfunctionThe listener function that gets removed.
thisObjectObject<optional>
thisthisObject - The Object of calling listener method.