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

ClearPass

Extends:

Pass → ClearPass

Indirect Implements:

A pass that clears the input buffer or the screen.

Constructor Summary

Public Constructor
public

constructor(color: Boolean, depth: Boolean, stencil: Boolean)

Constructs a new clear pass.

Member Summary

Public Members
public

Indicates whether the color buffer should be cleared.

public

Indicates whether the depth buffer should be cleared.

public
public

An override clear alpha.

public

An override clear color.

public

Indicates whether the stencil buffer should be cleared.

Method Summary

Public Methods
public

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

Clears the input buffer or the screen.

Inherited Summary

From class Pass
public get

Indicates whether this pass should render to screen.

public set

Sets the render to screen flag.

public
this member was deprecated. Use isEnabled() and setEnabled() instead.

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

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

Returns the current fullscreen material.

public

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

Performs initialization tasks.

public

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: Number)

Sets the depth texture.

public

setEnabled(enabled: Boolean)

Enables or disables this pass.

public

setSize(width: Number, height: Number)

Updates this pass with the renderer's size.

You may override this method in case you want to be informed about the size of the main frame buffer.

The EffectComposer calls this method before this pass is initialized and every time its own size is updated.

protected

setFullscreenMaterial(material: Material)

Sets the fullscreen material.

Public Constructors

public constructor(color: Boolean, depth: Boolean, stencil: Boolean) source

Constructs a new clear pass.

Override:

Pass#constructor

Params:

NameTypeAttributeDescription
color Boolean
  • optional
  • default: true

Determines whether the color buffer should be cleared.

depth Boolean
  • optional
  • default: true

Determines whether the depth buffer should be cleared.

stencil Boolean
  • optional
  • default: false

Determines whether the stencil buffer should be cleared.

Public Members

public color: Boolean source

Indicates whether the color buffer should be cleared.

public depth: Boolean source

Indicates whether the depth buffer should be cleared.

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 overrideClearAlpha: Number source

An override clear alpha.

The default value is -1.

public overrideClearColor: Color source

An override clear color.

The default value is null.

public stencil: Boolean source

Indicates whether the stencil buffer should be cleared.

Public Methods

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

Clears the input buffer or the screen.

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.