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 get

Indicates whether the masking is inverted.

public set

Determines whether the masking should be inverted.

public set

Sets the masking technique.

public set

maskTexture: Texture

Sets the mask texture.

public
public get

The current mask strength.

public set

Sets the strength of the mask.

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.

The default channel is RED.

public get inverted: Boolean source

Indicates whether the masking is inverted.

public set inverted: Boolean source

Determines whether the masking should be inverted.

public set maskFunction: MaskFunction source

Sets the masking technique.

The default function is DISCARD.

public set maskTexture: Texture source

Sets 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].

public set strength: Number source

Sets the strength of the mask.

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