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

MaskPass

Extends:

Pass → MaskPass

Indirect Implements:

A stencil mask pass.

This pass requires that the input and output buffers have a stencil buffer. You can enable the stencil buffer via the EffectComposer constructor.

Constructor Summary

Public Constructor
public

constructor(scene: Scene, camera: Camera)

Constructs a new mask pass.

Member Summary

Public Members
public

camera: *

public get
this get was deprecated. Use clearPass.enabled instead.

Indicates whether this pass should clear the stencil buffer.

public set
public

A clear pass.

public
this member was deprecated. Use inverted instead.

Inverse flag.

public get

Indicates whether the mask should be inverted.

public set
public set
public set
public
public

scene: *

Method Summary

Public Methods
public
this method was deprecated. Use clearPass.enabled instead.

Returns the internal clear pass.

public
this method was deprecated. Use inverted instead.

Indicates whether the mask is inverted.

public

render(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, outputBuffer: WebGLRenderTarget, deltaTime: Number, stencilTest: Boolean)

Renders the effect.

public
this method was deprecated. Use inverted instead.

Enables or disable mask inversion.

Inherited Summary

From class Pass
public get

fullscreenMaterial: Material

The fullscreen material.

public set
public set

mainCamera: Camera

Sets the main camera.

public set

mainScene: Scene

Sets the main scene.

public get

Sets the render to screen flag.

public set
public

Indicates whether this pass is enabled.

public

The name of this pass.

public

Only relevant for subclassing.

public

Only relevant for subclassing.

protected

camera: Camera

The camera.

protected

renderer: WebGLRenderer

this member was deprecated.

The renderer.

protected

scene: Scene

The scene to render.

public

Performs a shallow search for disposable properties and deletes them.

public

getDepthTexture(): Texture

Returns the current depth texture.

public

getFullscreenMaterial(): Material

this method was deprecated. Use fullscreenMaterial instead.

Returns the current fullscreen material.

public

initialize(renderer: WebGLRenderer, alpha: Boolean, frameBufferType: Number)

Performs initialization tasks.

public
this method was deprecated. Use enabled instead.

Indicates whether this pass is enabled.

public abstract

render(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, outputBuffer: WebGLRenderTarget, deltaTime: Number, stencilTest: Boolean)

Renders this pass.

public

setDepthTexture(depthTexture: Texture, depthPacking: DepthPackingStrategy)

Sets the depth texture.

public
this method was deprecated. Use enabled instead.

Enables or disables this pass.

public

setRenderer(renderer: WebGLRenderer)

this method was deprecated.

Sets the renderer

public

setSize(width: Number, height: Number)

Sets the size.

protected

setFullscreenMaterial(value: Material)

this method was deprecated. Use fullscreenMaterial instead.

Sets the fullscreen material.

Public Constructors

public constructor(scene: Scene, camera: Camera) source

Constructs a new mask pass.

Override:

Pass#constructor

Params:

NameTypeAttributeDescription
scene Scene

The scene to render.

camera Camera

The camera to use.

Public Members

public camera: * source

The camera.

Override:

Pass#camera

public get clear: Boolean source

this get was deprecated. Use clearPass.enabled instead.

Indicates whether this pass should clear the stencil buffer.

public set clear source

public clearPass: ClearPass source

A clear pass.

public inverse: Boolean source

this member was deprecated. Use inverted instead.

Inverse flag.

public get inverted: Boolean source

Indicates whether the mask should be inverted.

public set inverted source

public set mainCamera source

Sets the main camera.

Override:

Pass#mainCamera

public set mainScene source

Sets the main scene.

Override:

Pass#mainScene

public needsSwap: boolean source

Only relevant for subclassing.

Indicates whether the EffectComposer should swap the frame buffers after this pass has finished rendering. Set this to false if this pass doesn't render to the output buffer or the screen. Otherwise, the contents of the input buffer will be lost.

Override:

Pass#needsSwap

public scene: * source

The scene to render.

Override:

Pass#scene

Public Methods

public getClearPass(): ClearPass source

this method was deprecated. Use clearPass.enabled instead.

Returns the internal clear pass.

Return:

ClearPass

The clear pass.

public isInverted(): Boolean source

this method was deprecated. Use inverted instead.

Indicates whether the mask is inverted.

Return:

Boolean

Whether the mask is inverted.

public render(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, outputBuffer: WebGLRenderTarget, deltaTime: Number, stencilTest: Boolean) source

Renders the effect.

Override:

Pass#render

Params:

NameTypeAttributeDescription
renderer WebGLRenderer

The renderer.

inputBuffer WebGLRenderTarget

A frame buffer that contains the result of the previous pass.

outputBuffer WebGLRenderTarget

A frame buffer that serves as the output render target unless this pass renders to screen.

deltaTime Number
  • optional

The time between the last frame and the current one in seconds.

stencilTest Boolean
  • optional

Indicates whether a stencil mask is active.

public setInverted(value: Boolean) source

this method was deprecated. Use inverted instead.

Enables or disable mask inversion.

Params:

NameTypeAttributeDescription
value Boolean

Whether the mask should be inverted.