Capítulo 245 de 859

Chapter 245: ClearPass

Core Idea

This class can be used to force a clear operation for the current read or default framebuffer (when rendering to screen).

Key Concepts

  • clearAlpha : number: The clear alpha.
  • clearColor : number | Color | string: The clear color.
  • needsSwap : boolean: Overwritten to disable the swap.

Code Examples

const clearPass = new ClearPass();
composer.addPass( clearPass );
  • What it demonstrates: Typical usage of ClearPass.

Reference Tables

Constructor

Signature
`new ClearPass( clearColor : number

Properties

PropertyDescription
.clearAlpha : numberThe clear alpha.
`.clearColor : numberColor
.needsSwap : booleanOverwritten to disable the swap.

Methods

MethodDescription
.render( renderer : WebGLRenderer, writeBuffer : WebGLRenderTarget, readBuffer : WebGLRenderTarget, deltaTime : number, maskActive : boolean )Performs the clear operation. This affects the current read or the default framebuffer.

Key Takeaways

  1. ClearPass extends: Pass
  2. Most relevant properties: clearAlpha, clearColor, needsSwap.
  3. Key methods: render.

Connects To