Capítulo 449 de 859
Represents a render pass (sometimes called beauty pass) in context of post processing. This pass produces a render for the given scene and camera and can provide multiple outputs via MRT for further processing.
const postProcessing = new RenderPipeline( renderer );
const scenePass = pass( scene, camera );
postProcessing.outputNode = scenePass;
Constructor
| Signature |
|---|
| `new PassNode( scope : 'color' |
Properties
| Property | Description |
|---|---|
.camera : Camera | A reference to the camera. |
| `.contextNode : ContextNode | null` |
.global : boolean | This flag is used for global cache. |
.isPassNode : boolean (readonly) | This flag can be used for type testing. |
.opaque : boolean | Whether the pass is opaque. |
.options : Object | Options for the internal render target. |
| `.overrideMaterial : Material | null` |
.renderTarget : RenderTarget | The pass's render target. |
.scene : Scene | A reference to the scene. |
| `.scope : 'color' | 'depth'` |
.transparent : boolean | Whether the pass is transparent. |
.updateBeforeType : string | The updateBeforeType is set to NodeUpdateType.FRAME since the node renders the scene once per frame in its PassNode#updateBefore method. |
.COLOR : 'color' | |
.DEPTH : 'depth' |
Methods
| Method | Description |
|---|---|
.compileAsync( renderer : Renderer ) : Promise (async) | Precompiles the pass. |
.dispose() | Frees internal resources. Should be called when the node is no longer in use. |
.getLayers() : Layers | Gets the current layer configuration of the pass. |
.getLinearDepthNode( name : string ) : Node | Returns a linear depth node of this pass. |
.getMRT() : MRTNode | Returns the current MRT node. |
.getPreviousTexture( name : string ) : Texture | Returns the texture holding the data of the previous frame for the given output name. |
.getPreviousTextureNode( name : string ) : TextureNode | Returns the previous texture node for the given output name. |
.getResolution() : number | Gets the current resolution of the pass. |
.getResolutionScale() : number | Gets the current resolution scale of the pass. |
.getTexture( name : string ) : Texture | Returns the texture for the given output name. |
.getTextureNode( name : string ) : TextureNode | Returns the texture node for the given output name. |
.getViewZNode( name : string ) : Node | Returns a viewZ node of this pass. |
.setLayers( layers : Layers ) : PassNode | Sets the layer configuration that should be used when rendering the pass. |
.setMRT( mrt : MRTNode ) : PassNode | Sets the given MRT node to setup MRT for this pass. |
.setResolution( resolution : number ) : PassNode | Sets the resolution for the pass. The resolution is a factor that is multiplied with the renderer's width and height. |
.setResolutionScale( resolutionScale : number ) : PassNode | Sets the resolution scale for the pass. The resolution scale is a factor that is multiplied with the renderer's width and height. |
| `.setScissor( x : number | Vector4, y : number, width : number, height : number )` |
.setSize( width : number, height : number ) | Sets the size of the pass's render target. Honors the pixel ratio. |
| `.setViewport( x : number | Vector4, y : number, width : number, height : number )` |
.toggleTexture( name : string ) | Switches current and previous textures for the given output name. |