t3d. Texture3D

Creates a 3D texture. (WebGL 2.0)

Constructor

new Texture3D()

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

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) isTexture3D :Boolean

Type:
  • Boolean
Default Value
  • true

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

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

wrapR :t3d.TEXTURE_WRAP

This defines how the texture is wrapped in the depth direction.
Default Value
  • t3d.TEXTURE_WRAP.CLAMP_TO_EDGE

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.Texture3D}

Copy the given 3d texture into this texture.
Parameters:
NameTypeDescription
sourcet3d.Texture3DThe 3d texture to be copied.
Returns:
Type: 
t3d.Texture3D

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.