DepthTexture2D

DepthTexture2D

A texture class to represent a 2D depth texture.

Constructor

new DepthTexture2D(spec)

Instantiates a DepthTexture2D object.
Source:
Parameters:
Name Type Description
spec Object The specification arguments.
Name Type Description
src Uint8Array | Uint16Array | Uint32Array The data to buffer.
width number The width of the texture.
height number The height of the texture.
wrap string The wrapping type over both S and T dimension.
wrapS string The wrapping type over the S dimension.
wrapT string The wrapping type over the T dimension.
filter string The min / mag filter used during scaling.
minFilter string The minification filter used during scaling.
magFilter string The magnification filter used during scaling.
format string The texture pixel format.
type string The texture pixel component type.

Extends

Methods

bind(location) → {Texture2D}

Binds the texture object to the provided texture unit location.
Inherited From:
Source:
Parameters:
Name Type Default Description
location number 0 The texture unit location index. Defaults to 0.
Returns:
Type:
Texture2D
The texture object, for chaining.

bufferData(data, width, height) → {Texture2D}

Buffer data into the texture.
Inherited From:
Source:
Parameters:
Name Type Description
data Array | ArrayBuffer The data array to buffer.
width number The width of the data.
height number The height of the data.
Returns:
Type:
Texture2D
The texture object, for chaining.

bufferSubData(data, xOffset, yOffset, width, height) → {Texture2D}

Buffer partial data into the texture.
Inherited From:
Source:
Parameters:
Name Type Default Description
data Array | ArrayBuffer The data array to buffer.
xOffset number 0 The x offset at which to buffer.
yOffset number 0 The y offset at which to buffer.
width number The width of the data.
height number The height of the data.
Returns:
Type:
Texture2D
The texture object, for chaining.

resize(width, height) → {Texture2D}

Resize the underlying texture. This clears the texture data.
Inherited From:
Source:
Parameters:
Name Type Description
width number The new width of the texture.
height number The new height of the texture.
Returns:
Type:
Texture2D
The texture object, for chaining.

setParameters(params) → {Texture2D}

Set the texture parameters.
Inherited From:
Source:
Parameters:
Name Type Description
params Object The parameters by name.
Name Type Description
wrap string The wrapping type over both S and T dimension.
wrapS string The wrapping type over the S dimension.
wrapT string The wrapping type over the T dimension.
filter string The min / mag filter used during scaling.
minFilter string The minification filter used during scaling.
magFilter string The magnification filter used during scaling.
Returns:
Type:
Texture2D
The texture object, for chaining.

unbind() → {Texture2D}

Unbinds the texture object.
Inherited From:
Source:
Returns:
Type:
Texture2D
The texture object, for chaining.