MRTNode.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>MRTNode - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Node.html">Node</a> → <a href="OutputStructNode.html">OutputStructNode</a> → </p>
  13. <h1 translate="no">MRTNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This node can be used setup a MRT context for rendering. A typical MRT setup for
  17. post-processing is shown below:</p>
  18. <p>The MRT output is defined as a dictionary.</p></div>
  19. <h2>Code Example</h2>
  20. <div translate="no"><pre><code class="language-js">const mrtNode = mrt( {
  21. output: output,
  22. normal: normalView
  23. } ) ;
  24. </code></pre></div>
  25. </header>
  26. <article>
  27. <div class="container-overview">
  28. <h2>Constructor</h2>
  29. <h3 class="name name-method" id="MRTNode" translate="no">new <a href="#MRTNode">MRTNode</a><span class="signature">( outputNodes : <span class="param-type">Object.&lt;string, <a href="Node.html">Node</a>></span> )</span> </h3>
  30. <div class="method">
  31. <div class="description">
  32. <p>Constructs a new output struct node.</p>
  33. </div>
  34. <table class="params">
  35. <tbody>
  36. <tr>
  37. <td class="name">
  38. <strong translate="no">outputNodes</strong>
  39. </td>
  40. <td class="description last">
  41. <p>The MRT outputs.</p>
  42. </td>
  43. </tr>
  44. </tbody>
  45. </table>
  46. </div>
  47. </div>
  48. <h2 class="subsection-title">Properties</h2>
  49. <div class="member">
  50. <h3 class="name" id="blendModes" translate="no">.<a href="#blendModes">blendModes</a><span class="type-signature"> : Object.&lt;string, <a href="BlendMode.html">BlendMode</a>></span> </h3>
  51. <div class="description">
  52. <p>A dictionary storing the blend modes for each output.</p>
  53. </div>
  54. </div>
  55. <div class="member">
  56. <h3 class="name" id="isMRTNode" translate="no">.<a href="#isMRTNode">isMRTNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  57. <div class="description">
  58. <p>This flag can be used for type testing.</p>
  59. <p>Default is <code>true</code>.</p>
  60. </div>
  61. </div>
  62. <div class="member">
  63. <h3 class="name" id="outputNodes" translate="no">.<a href="#outputNodes">outputNodes</a><span class="type-signature"> : Object.&lt;string, <a href="Node.html">Node</a>></span> </h3>
  64. <div class="description">
  65. <p>A dictionary representing the MRT outputs. The key
  66. is the name of the output, the value the node which produces
  67. the output result.</p>
  68. </div>
  69. </div>
  70. <h2 class="subsection-title">Methods</h2>
  71. <h3 class="name name-method" id="get" translate="no">.<a href="#get">get</a><span class="signature">( name : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  72. <div class="method">
  73. <div class="description">
  74. <p>Returns the output node for the given name.</p>
  75. </div>
  76. <table class="params">
  77. <tbody>
  78. <tr>
  79. <td class="name">
  80. <strong translate="no">name</strong>
  81. </td>
  82. <td class="description last">
  83. <p>The name of the output.</p>
  84. </td>
  85. </tr>
  86. </tbody>
  87. </table>
  88. <dl class="details">
  89. <dt class="tag-returns"><strong>Returns:</strong> The output node.</dt>
  90. </dl>
  91. </div>
  92. <h3 class="name name-method" id="getBlendMode" translate="no">.<a href="#getBlendMode">getBlendMode</a><span class="signature">( name : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="BlendMode.html">BlendMode</a></span> </h3>
  93. <div class="method">
  94. <div class="description">
  95. <p>Returns the blend mode for the given output name.</p>
  96. </div>
  97. <table class="params">
  98. <tbody>
  99. <tr>
  100. <td class="name">
  101. <strong translate="no">name</strong>
  102. </td>
  103. <td class="description last">
  104. <p>The name of the output.</p>
  105. </td>
  106. </tr>
  107. </tbody>
  108. </table>
  109. <dl class="details">
  110. <dt class="tag-returns"><strong>Returns:</strong> The blend mode.</dt>
  111. </dl>
  112. </div>
  113. <h3 class="name name-method" id="has" translate="no">.<a href="#has">has</a><span class="signature">( name : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="NodeBuilder.html">NodeBuilder</a></span> </h3>
  114. <div class="method">
  115. <div class="description">
  116. <p>Returns <code>true</code> if the MRT node has an output with the given name.</p>
  117. </div>
  118. <table class="params">
  119. <tbody>
  120. <tr>
  121. <td class="name">
  122. <strong translate="no">name</strong>
  123. </td>
  124. <td class="description last">
  125. <p>The name of the output.</p>
  126. </td>
  127. </tr>
  128. </tbody>
  129. </table>
  130. <dl class="details">
  131. <dt class="tag-returns"><strong>Returns:</strong> Whether the MRT node has an output for the given name or not.</dt>
  132. </dl>
  133. </div>
  134. <h3 class="name name-method" id="merge" translate="no">.<a href="#merge">merge</a><span class="signature">( mrtNode : <span class="param-type"><a href="MRTNode.html">MRTNode</a></span> )</span><span class="type-signature"> : <a href="MRTNode.html">MRTNode</a></span> </h3>
  135. <div class="method">
  136. <div class="description">
  137. <p>Merges the outputs of the given MRT node with the outputs of this node.</p>
  138. </div>
  139. <table class="params">
  140. <tbody>
  141. <tr>
  142. <td class="name">
  143. <strong translate="no">mrtNode</strong>
  144. </td>
  145. <td class="description last">
  146. <p>The MRT to merge.</p>
  147. </td>
  148. </tr>
  149. </tbody>
  150. </table>
  151. <dl class="details">
  152. <dt class="tag-returns"><strong>Returns:</strong> A new MRT node with merged outputs..</dt>
  153. </dl>
  154. </div>
  155. <h3 class="name name-method" id="setBlendMode" translate="no">.<a href="#setBlendMode">setBlendMode</a><span class="signature">( name : <span class="param-type">string</span>, blend : <span class="param-type"><a href="BlendMode.html">BlendMode</a></span> )</span><span class="type-signature"> : <a href="MRTNode.html">MRTNode</a></span> </h3>
  156. <div class="method">
  157. <div class="description">
  158. <p>Sets the blend mode for the given output name.</p>
  159. </div>
  160. <table class="params">
  161. <tbody>
  162. <tr>
  163. <td class="name">
  164. <strong translate="no">name</strong>
  165. </td>
  166. <td class="description last">
  167. <p>The name of the output.</p>
  168. </td>
  169. </tr>
  170. <tr>
  171. <td class="name">
  172. <strong translate="no">blend</strong>
  173. </td>
  174. <td class="description last">
  175. <p>The blending mode.</p>
  176. </td>
  177. </tr>
  178. </tbody>
  179. </table>
  180. <dl class="details">
  181. <dt class="tag-returns"><strong>Returns:</strong> The current MRT node.</dt>
  182. </dl>
  183. </div>
  184. <h2 class="subsection-title">Source</h2>
  185. <p>
  186. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/core/MRTNode.js" translate="no" target="_blank" rel="noopener">src/nodes/core/MRTNode.js</a>
  187. </p>
  188. </article>
  189. </section>
  190. <script src="../scripts/linenumber.js"></script>
  191. <script src="../scripts/page.js"></script>
  192. </body>
  193. </html>
粤ICP备19079148号