Capítulo 766 de 859

Chapter 766: RenderPipeline

Core Idea

This module is responsible to manage the rendering pipeline setups in apps. You usually create a single instance of this class and use it to define the output of your render pipeline and post processing effect chain.

Note: This module can only be used with WebGPURenderer.

Key Concepts

  • context : Object (readonly): Returns the current context of the render pipeline stack.
  • needsUpdate : Node.<vec4>: Must be set to true when the output node changes.
  • outputColorTransform : boolean: Whether the default output tone mapping and color space transformation should be enabled or not.
  • outputNode : Node.<vec4>: A node which defines the final output of the rendering pipeline. This is usually the last node in a chain of effect nodes.
  • renderer : Renderer: A reference to the renderer.

Code Examples

const renderPipeline = new RenderPipeline( renderer );
const scenePass = pass( scene, camera );
renderPipeline.outputNode = scenePass;
  • What it demonstrates: Typical usage of RenderPipeline.

Reference Tables

Constructor

Signature
new RenderPipeline( renderer : Renderer, outputNode : Node.<vec4> )

Properties

PropertyDescription
.context : Object (readonly)Returns the current context of the render pipeline stack.
.needsUpdate : Node.<vec4>Must be set to true when the output node changes.
.outputColorTransform : booleanWhether the default output tone mapping and color space transformation should be enabled or not.
.outputNode : Node.<vec4>A node which defines the final output of the rendering pipeline. This is usually the last node in a chain of effect nodes.
.renderer : RendererA reference to the renderer.

Methods

MethodDescription
.dispose()Frees internal resources.
.render()When RenderPipeline is used to apply rendering pipeline and post processing effects, the application must use this version of render() inside its animation loop (not the one from the renderer).
.renderAsync() : Promise (async)When RenderPipeline is used to apply rendering pipeline and post processing effects, the application must use this version of renderAsync() inside its animation loop (not the one from the rendere…

Key Takeaways

  1. Most relevant properties: context, needsUpdate, outputColorTransform, outputNode.
  2. Key methods: dispose, render, renderAsync.

Connects To