Texture

DepthTexture

This class can be used to automatically save the depth information of a rendering into a texture. When using a WebGL 1 rendering context, DepthTexture requires support for the WEBGL_depth_texture extension.

Constructor

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

width — width of the texture.
height — height of the texture.
type — Default is v3d.UnsignedIntType when using DepthFormat and v3d.UnsignedInt248Type when using DepthStencilFormat. See type constants for other choices.
mapping — See mapping mode 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.UnsignedIntType when using DepthFormat and v3d.UnsignedInt248Type when using DepthStencilFormat. 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.

.isDepthTexture : Boolean

Read-only flag to check if a given object is of type DepthTexture.

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.