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

MaskMaterial

Extends:

three~ShaderMaterial → MaskMaterial

A mask shader material.

This material applies a mask texture to a buffer.

Constructor Summary

Public Constructor
public

constructor(maskTexture: Texture)

Constructs a new mask material.

Member Summary

Public Members
public set

Sets the color channel to use for masking.

public set

inputBuffer: Texture

The input buffer.

public get

Indicates whether the masking is inverted.

public set
public set

The masking technique.

public set

maskTexture: Texture

The mask texture.

public
public get

The current mask strength.

public set

Method Summary

Public Methods
public
this method was deprecated. Use strength instead.

Returns the current mask strength.

public
this method was deprecated. Use inverted instead.

Indicates whether the masking is inverted.

public
this method was deprecated. Use colorChannel instead.

Sets the color channel to use for masking.

public

setInputBuffer(value: Texture)

this method was deprecated. Use inputBuffer instead.

Sets the input buffer.

public
this method was deprecated. Use inverted instead.

Determines whether the masking should be inverted.

public
this method was deprecated. Use maskFunction instead.

Sets the masking technique.

public

setMaskTexture(value: Texture)

this method was deprecated. Use maskTexture instead.

Sets the mask texture.

public
this method was deprecated. Use strength instead.

Sets the mask strength.

Public Constructors

public constructor(maskTexture: Texture) source

Constructs a new mask material.

Params:

NameTypeAttributeDescription
maskTexture Texture
  • optional

The mask texture.

Public Members

public set colorChannel: ColorChannel source

Sets the color channel to use for masking. Default is ColorChannel.RED.

public set inputBuffer: Texture source

The input buffer.

public get inverted: Boolean source

Indicates whether the masking is inverted.

public set inverted source

public set maskFunction: MaskFunction source

The masking technique. Default is MaskFunction.DISCARD.

public set maskTexture: Texture source

The mask texture.

public needsUpdate: boolean source

public get strength: Number source

The current mask strength.

Individual mask values will be clamped to [0.0, 1.0]. Has no effect when the mask function is set to DISCARD.

public set strength source

Public Methods

public getStrength(): Number source

this method was deprecated. Use strength instead.

Returns the current mask strength.

Return:

Number

The mask strength.

public isInverted(): Boolean source

this method was deprecated. Use inverted instead.

Indicates whether the masking is inverted.

Return:

Boolean

Whether the masking is inverted.

public setColorChannel(value: ColorChannel) source

this method was deprecated. Use colorChannel instead.

Sets the color channel to use for masking. Default is ColorChannel.RED.

Params:

NameTypeAttributeDescription
value ColorChannel

The channel.

public setInputBuffer(value: Texture) source

this method was deprecated. Use inputBuffer instead.

Sets the input buffer.

Params:

NameTypeAttributeDescription
value Texture

The input buffer.

public setInverted(value: Boolean) source

this method was deprecated. Use inverted instead.

Determines whether the masking should be inverted.

Params:

NameTypeAttributeDescription
value Boolean

Whether the masking should be inverted.

public setMaskFunction(value: MaskFunction) source

this method was deprecated. Use maskFunction instead.

Sets the masking technique. Default is MaskFunction.DISCARD.

Params:

NameTypeAttributeDescription
value MaskFunction

The function.

public setMaskTexture(value: Texture) source

this method was deprecated. Use maskTexture instead.

Sets the mask texture.

Params:

NameTypeAttributeDescription
value Texture

The texture.

public setStrength(value: Number) source

this method was deprecated. Use strength instead.

Sets the mask strength.

Has no effect when the mask function is set to DISCARD.

Params:

NameTypeAttributeDescription
value Number

The mask strength.