Capítulo 264 de 859

Chapter 264: RenderPass

Core Idea

This class represents a render pass. It takes a camera and a scene and produces a beauty pass for subsequent post processing effects.

Key Concepts

  • camera : Camera: The camera.
  • clear : boolean: Overwritten to perform a clear operation by default.
  • clearAlpha : number: The clear alpha of the render pass.
  • clearColor : number | Color | string: The clear color of the render pass.
  • clearDepth : boolean: If set to true, only the depth can be cleared when clear is to false.
  • isRenderPass : boolean (readonly): This flag indicates that this pass renders the scene itself.
  • needsSwap : boolean: Overwritten to disable the swap.
  • overrideMaterial : Material: The override material. If set, this material is used for all objects in the scene.
  • scene : Scene: The scene to render.

Code Examples

const renderPass = new RenderPass( scene, camera );
composer.addPass( renderPass );
  • What it demonstrates: Typical usage of RenderPass.

Reference Tables

Constructor

Signature
`new RenderPass( scene : Scene, camera : Camera, overrideMaterial : Material, clearColor : number

Properties

PropertyDescription
.camera : CameraThe camera.
.clear : booleanOverwritten to perform a clear operation by default.
.clearAlpha : numberThe clear alpha of the render pass.
`.clearColor : numberColor
.clearDepth : booleanIf set to true, only the depth can be cleared when clear is to false.
.isRenderPass : boolean (readonly)This flag indicates that this pass renders the scene itself.
.needsSwap : booleanOverwritten to disable the swap.
.overrideMaterial : MaterialThe override material. If set, this material is used for all objects in the scene.
.scene : SceneThe scene to render.

Methods

MethodDescription
.render( renderer : WebGLRenderer, writeBuffer : WebGLRenderTarget, readBuffer : WebGLRenderTarget, deltaTime : number, maskActive : boolean )Performs a beauty pass with the configured scene and camera.

Key Takeaways

  1. RenderPass extends: Pass
  2. Most relevant properties: camera, clear, clearAlpha, clearColor.
  3. Key methods: render.

Connects To