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 get

Indicates whether the background should be preserved.

public set

Controls whether the background will be preserved or discarded.

public

Method Summary

Public Methods
public

Returns the current depth mode.

public

Returns the current error threshold for depth comparisons.

public

Sets the depth mode.

public

setEpsilon(value: Number)

Sets the depth comparison error threshold.

Public Constructors

public constructor() source

Constructs a new depth mask material.

Public Members

public get keepFar: Boolean source

Indicates whether the background should be preserved.

Enabled by default.

public set keepFar: Boolean source

Controls whether the background will be preserved or discarded.

public needsUpdate: boolean source

Public Methods

public getDepthMode(): Number source

Returns the current depth mode.

Return:

Number

The depth mode.

public getEpsilon(): Number source

Returns the current error threshold for depth comparisons.

This value is only used for EqualDepth and NotEqualDepth.

Return:

Number

The error threshold. Default is 1e-5.

public setDepthMode(mode: Number) source

Sets the depth mode.

Default is LessDepth.

Params:

NameTypeAttributeDescription
mode Number

The depth mode.

See:

public setEpsilon(value: Number) source

Sets the depth comparison error threshold.

This value is only used for EqualDepth and NotEqualDepth.

Params:

NameTypeAttributeDescription
value Number

The new error threshold.