Capítulo 437 de 859

Chapter 437: MRTNode

Core Idea

This node can be used setup a MRT context for rendering. A typical MRT setup for post-processing is shown below:

The MRT output is defined as a dictionary.

Key Concepts

  • blendModes : Object.<string, BlendMode>: A dictionary storing the blend modes for each output.
  • isMRTNode : boolean (readonly): This flag can be used for type testing.
  • outputNodes : Object.<string, Node>: A dictionary representing the MRT outputs. The key is the name of the output, the value the node which produces the output result.

Code Examples

const mrtNode = mrt( {
  output: output,
  normal: normalView
} ) ;
  • What it demonstrates: Typical usage of MRTNode.

Reference Tables

Constructor

Signature
new MRTNode( outputNodes : Object.<string, Node> )

Properties

PropertyDescription
.blendModes : Object.<string, BlendMode>A dictionary storing the blend modes for each output.
.isMRTNode : boolean (readonly)This flag can be used for type testing.
.outputNodes : Object.<string, Node>A dictionary representing the MRT outputs. The key is the name of the output, the value the node which produces the output result.

Methods

MethodDescription
.get( name : string ) : NodeReturns the output node for the given name.
.getBlendMode( name : string ) : BlendModeReturns the blend mode for the given output name.
.has( name : string ) : NodeBuilderReturns true if the MRT node has an output with the given name.
.merge( mrtNode : MRTNode ) : MRTNodeMerges the outputs of the given MRT node with the outputs of this node.
.setBlendMode( name : string, blend : BlendMode ) : MRTNodeSets the blend mode for the given output name.

Key Takeaways

  1. MRTNode extends: EventDispatcher → Node → OutputStructNode
  2. Most relevant properties: blendModes, isMRTNode, outputNodes.
  3. Key methods: get, getBlendMode, has, merge.

Connects To