Texture

DepthTexture

Creates a texture for use as a Depth Texture. Require support for the WEBGL_depth_texture extension.

Example

depth / texture

Constructor

DepthTexture(width : Number, height : Number, type : Constant, wrapS : Constant, wrapT : Constant, magFilter : Constant, minFilter : Constant, anisotropy : Number, format : Constant)

width -- width of the texture.
height -- height of the texture.
type -- Default is v3d.UnsignedShortType. See type constants for other choices.
mapping -- See type constants for details.
wrapS -- The default is v3d.ClampToEdgeWrapping. See wrap mode constants for other choices.
wrapT -- The default is v3d.ClampToEdgeWrapping. See wrap mode constants for other choices.
magFilter -- How the texture is sampled when a texel covers more than one pixel. The default is v3d.NearestFilter. See magnification filter constants for other choices.
minFilter -- How the texture is sampled when a texel covers less than one pixel. The default is v3d.NearestFilter. See minification filter constants for other choices.
anisotropy -- The number of samples taken along the axis through the pixel that has the highest density of texels. By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use renderer.getMaxAnisotropy() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
format -- must be either DepthFormat (default) or DepthStencilFormat. See format constants for details.

Properties

See the base Texture class for common properties - the following are also part of the texture class, but have different defaults here.

.format

Either DepthFormat (default) or DepthStencilFormat. See format constants for details.

.type

Default is v3d.UnsignedShortType. See format constants for details.

.magFilter

How the texture is sampled when a texel covers more than one pixel. The default is v3d.NearestFilter. See magnification filter constants for other choices.

.minFilter

How the texture is sampled when a texel covers less than one pixel. The default is v3d.NearestFilter. See magnification filter constants for other choices.

.flipY

Depth textures do not need to be flipped so this is false by default.

.generateMipmaps

Depth textures do not use mipmaps.

Methods

See the base Texture class for common methods.

Source

For more info on how to obtain the source code of this module see this page.