Home Reference Source
import {DepthMaskMaterial} from 'postprocessing'
public class | source

DepthMaskMaterial

Extends:

three~ShaderMaterial → DepthMaskMaterial

A depth mask shader material.

This material masks a color buffer by comparing two depth textures.

Constructor Summary

Public Constructor
public

Constructs a new depth mask material.

Member Summary

Public Members
public set

depthBuffer0: Texture

The primary depth buffer.

public set

depthBuffer1: Texture

The secondary depth buffer.

public get

depthMode: DepthModes

The depth mode.

public set
public set

depthPacking0: DepthPackingStrategies

The primary depth packing strategy.

public set

depthPacking1: DepthPackingStrategies

The secondary depth packing strategy.

public get

A small error threshold that is used for EqualDepth and NotEqualDepth tests.

public set
public get
this get was deprecated. Use maxDepthStrategy instead.

Indicates whether maximum depth values should be preserved.

public set
public get

The strategy for handling maximum depth.

public set
public

Method Summary

Public Methods
public

adoptCameraSettings(camera: Camera)

this method was deprecated. Use copyCameraSettings instead.

Copies the settings of the given camera.

public

copyCameraSettings(camera: Camera)

Copies the settings of the given camera.

public

getDepthMode(): DepthModes

this method was deprecated. Use depthMode instead.

Returns the current depth mode.

public
this method was deprecated. Use epsilon instead.

Returns the current error threshold for depth comparisons.

public
this method was deprecated. Use maxDepthStrategy instead.

Returns the strategy for dealing with maximum depth values.

public

setDepthBuffer0(buffer: Texture, depthPacking: DepthPackingStrategies)

this method was deprecated. Use depthBuffer0 and depthPacking0 instead.

Sets the base depth buffer.

public

setDepthBuffer1(buffer: Texture, depthPacking: DepthPackingStrategies)

this method was deprecated. Use depthBuffer1 and depthPacking1 instead.

Sets the depth buffer that will be compared with the base depth buffer.

public

setDepthMode(mode: DepthModes)

this method was deprecated. Use depthMode instead.

Sets the depth mode.

public

setEpsilon(value: Number)

this method was deprecated. Use epsilon instead.

Sets the depth comparison error threshold.

public
this method was deprecated. Use maxDepthStrategy instead.

Sets the strategy for dealing with maximum depth values.

Public Constructors

public constructor() source

Constructs a new depth mask material.

Public Members

public set depthBuffer0: Texture source

The primary depth buffer.

public set depthBuffer1: Texture source

The secondary depth buffer.

public get depthMode: DepthModes source

The depth mode.

See:

public set depthMode source

public set depthPacking0: DepthPackingStrategies source

The primary depth packing strategy.

public set depthPacking1: DepthPackingStrategies source

The secondary depth packing strategy.

public get epsilon: Number source

A small error threshold that is used for EqualDepth and NotEqualDepth tests. Default is 1e-4.

public set epsilon source

public get keepFar: Boolean source

this get was deprecated. Use maxDepthStrategy instead.

Indicates whether maximum depth values should be preserved.

public set keepFar source

public get maxDepthStrategy: DepthTestStrategy source

The strategy for handling maximum depth.

public set maxDepthStrategy source

public needsUpdate: boolean source

Public Methods

public adoptCameraSettings(camera: Camera) source

this method was deprecated. Use copyCameraSettings instead.

Copies the settings of the given camera.

Params:

NameTypeAttributeDescription
camera Camera

A camera.

public copyCameraSettings(camera: Camera) source

Copies the settings of the given camera.

Params:

NameTypeAttributeDescription
camera Camera

A camera.

public getDepthMode(): DepthModes source

this method was deprecated. Use depthMode instead.

Returns the current depth mode.

Return:

DepthModes

The depth mode. Default is LessDepth.

public getEpsilon(): Number source

this method was deprecated. Use epsilon instead.

Returns the current error threshold for depth comparisons.

Return:

Number

The error threshold.

public getMaxDepthStrategy(): DepthTestStrategy source

this method was deprecated. Use maxDepthStrategy instead.

Returns the strategy for dealing with maximum depth values.

Return:

DepthTestStrategy

The strategy.

public setDepthBuffer0(buffer: Texture, depthPacking: DepthPackingStrategies) source

this method was deprecated. Use depthBuffer0 and depthPacking0 instead.

Sets the base depth buffer.

Params:

NameTypeAttributeDescription
buffer Texture

The depth texture.

depthPacking DepthPackingStrategies
  • optional
  • default: BasicDepthPacking

The depth packing strategy.

public setDepthBuffer1(buffer: Texture, depthPacking: DepthPackingStrategies) source

this method was deprecated. Use depthBuffer1 and depthPacking1 instead.

Sets the depth buffer that will be compared with the base depth buffer.

Params:

NameTypeAttributeDescription
buffer Texture

The depth texture.

depthPacking DepthPackingStrategies
  • optional
  • default: BasicDepthPacking

The depth packing strategy.

public setDepthMode(mode: DepthModes) source

this method was deprecated. Use depthMode instead.

Sets the depth mode.

Params:

NameTypeAttributeDescription
mode DepthModes

The depth mode.

public setEpsilon(value: Number) source

this method was deprecated. Use epsilon instead.

Sets the depth comparison error threshold.

Params:

NameTypeAttributeDescription
value Number

The new error threshold.

public setMaxDepthStrategy(value: DepthTestStrategy) source

this method was deprecated. Use maxDepthStrategy instead.

Sets the strategy for dealing with maximum depth values.

Params:

NameTypeAttributeDescription
value DepthTestStrategy

The strategy.