RTTNode.html 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>RTTNode - 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="InputNode.html">InputNode</a> → <a href="UniformNode.html">UniformNode</a> → <a href="TextureNode.html">TextureNode</a> → </p>
  13. <h1 translate="no">RTTNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p><code>RTTNode</code> takes another node and uses it with a <code>QuadMesh</code> to render into a texture (RTT).
  17. This module is especially relevant in context of post processing where certain nodes require
  18. texture input for their effects. With the helper function <code>convertToTexture()</code> which is based
  19. on this module, the node system can automatically ensure texture input if required.</p></div>
  20. </header>
  21. <article>
  22. <div class="container-overview">
  23. <h2>Constructor</h2>
  24. <h3 class="name name-method" id="RTTNode" translate="no">new <a href="#RTTNode">RTTNode</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span>, width : <span class="param-type">number</span>, height : <span class="param-type">number</span>, options : <span class="param-type">Object</span> )</span> </h3>
  25. <div class="method">
  26. <div class="description">
  27. <p>Constructs a new RTT node.</p>
  28. </div>
  29. <table class="params">
  30. <tbody>
  31. <tr>
  32. <td class="name">
  33. <strong translate="no">node</strong>
  34. </td>
  35. <td class="description last">
  36. <p>The node to render a texture with.</p>
  37. </td>
  38. </tr>
  39. <tr>
  40. <td class="name">
  41. <strong translate="no">width</strong>
  42. </td>
  43. <td class="description last">
  44. <p>The width of the internal render target. If not width is applied, the render target is automatically resized.</p>
  45. <p>Default is <code>null</code>.</p>
  46. </td>
  47. </tr>
  48. <tr>
  49. <td class="name">
  50. <strong translate="no">height</strong>
  51. </td>
  52. <td class="description last">
  53. <p>The height of the internal render target.</p>
  54. <p>Default is <code>null</code>.</p>
  55. </td>
  56. </tr>
  57. <tr>
  58. <td class="name">
  59. <strong translate="no">options</strong>
  60. </td>
  61. <td class="description last">
  62. <p>The options for the internal render target.</p>
  63. <p>Default is <code>{type:HalfFloatType}</code>.</p>
  64. </td>
  65. </tr>
  66. </tbody>
  67. </table>
  68. </div>
  69. </div>
  70. <h2 class="subsection-title">Properties</h2>
  71. <div class="member">
  72. <h3 class="name" id="autoResize" translate="no">.<a href="#autoResize">autoResize</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  73. <div class="description">
  74. <p>Whether the internal render target should automatically be resized or not.</p>
  75. <p>Default is <code>true</code>.</p>
  76. </div>
  77. </div>
  78. <div class="member">
  79. <h3 class="name" id="autoUpdate" translate="no">.<a href="#autoUpdate">autoUpdate</a><span class="type-signature"> : boolean</span> </h3>
  80. <div class="description">
  81. <p>Whether the texture should automatically be updated or not.</p>
  82. <p>Default is <code>true</code>.</p>
  83. </div>
  84. </div>
  85. <div class="member">
  86. <h3 class="name" id="height" translate="no">.<a href="#height">height</a><span class="type-signature"> : number</span> </h3>
  87. <div class="description">
  88. <p>The height of the internal render target.</p>
  89. <p>Default is <code>null</code>.</p>
  90. </div>
  91. </div>
  92. <div class="member">
  93. <h3 class="name" id="isRTTNode" translate="no">.<a href="#isRTTNode">isRTTNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  94. <div class="description">
  95. <p>This flag can be used for type testing.</p>
  96. <p>Default is <code>true</code>.</p>
  97. </div>
  98. </div>
  99. <div class="member">
  100. <h3 class="name" id="node" translate="no">.<a href="#node">node</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  101. <div class="description">
  102. <p>The node to render a texture with.</p>
  103. </div>
  104. </div>
  105. <div class="member">
  106. <h3 class="name" id="renderTarget" translate="no">.<a href="#renderTarget">renderTarget</a><span class="type-signature"> : <a href="RenderTarget.html">RenderTarget</a></span> </h3>
  107. <div class="description">
  108. <p>The render target</p>
  109. </div>
  110. </div>
  111. <div class="member">
  112. <h3 class="name" id="textureNeedsUpdate" translate="no">.<a href="#textureNeedsUpdate">textureNeedsUpdate</a><span class="type-signature"> : boolean</span> </h3>
  113. <div class="description">
  114. <p>Whether the texture requires an update or not.</p>
  115. <p>Default is <code>true</code>.</p>
  116. </div>
  117. </div>
  118. <div class="member">
  119. <h3 class="name" id="updateBeforeType" translate="no">.<a href="#updateBeforeType">updateBeforeType</a><span class="type-signature"> : string</span> </h3>
  120. <div class="description">
  121. <p>The <code>updateBeforeType</code> is set to <code>NodeUpdateType.RENDER</code> since the node updates
  122. the texture once per render in its <a href="RTTNode.html#updateBefore">RTTNode#updateBefore</a> method.</p>
  123. <p>Default is <code>'render'</code>.</p>
  124. </div>
  125. <dl class="details">
  126. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TextureNode.html#updateBeforeType">TextureNode#updateBeforeType</a></dt>
  127. </dl>
  128. </div>
  129. <div class="member">
  130. <h3 class="name" id="width" translate="no">.<a href="#width">width</a><span class="type-signature"> : number</span> </h3>
  131. <div class="description">
  132. <p>The width of the internal render target.
  133. If not width is applied, the render target is automatically resized.</p>
  134. <p>Default is <code>null</code>.</p>
  135. </div>
  136. </div>
  137. <h2 class="subsection-title">Methods</h2>
  138. <h3 class="name name-method" id="getResolutionScale" translate="no">.<a href="#getResolutionScale">getResolutionScale</a><span class="signature">()</span><span class="type-signature"> : number</span> </h3>
  139. <div class="method">
  140. <div class="description">
  141. <p>Gets the resolution scale.</p>
  142. </div>
  143. <dl class="details">
  144. <dt class="tag-returns"><strong>Returns:</strong> The resolution scale.</dt>
  145. </dl>
  146. </div>
  147. <h3 class="name name-method" id="setResolutionScale" translate="no">.<a href="#setResolutionScale">setResolutionScale</a><span class="signature">( resolutionScale : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="RTTNode.html">RTTNode</a></span> </h3>
  148. <div class="method">
  149. <div class="description">
  150. <p>Sets the resolution scale.
  151. The resolution scale is a factor that is multiplied with the renderer's width and height.</p>
  152. </div>
  153. <table class="params">
  154. <tbody>
  155. <tr>
  156. <td class="name">
  157. <strong translate="no">resolutionScale</strong>
  158. </td>
  159. <td class="description last">
  160. <p>The resolution scale to set. A value of <code>1</code> means full resolution.</p>
  161. </td>
  162. </tr>
  163. </tbody>
  164. </table>
  165. <dl class="details">
  166. <dt class="tag-returns"><strong>Returns:</strong> A reference to this node.</dt>
  167. </dl>
  168. </div>
  169. <h3 class="name name-method" id="setSize" translate="no">.<a href="#setSize">setSize</a><span class="signature">( width : <span class="param-type">number</span>, height : <span class="param-type">number</span> )</span> </h3>
  170. <div class="method">
  171. <div class="description">
  172. <p>Sets the size of the internal render target</p>
  173. </div>
  174. <table class="params">
  175. <tbody>
  176. <tr>
  177. <td class="name">
  178. <strong translate="no">width</strong>
  179. </td>
  180. <td class="description last">
  181. <p>The width to set.</p>
  182. </td>
  183. </tr>
  184. <tr>
  185. <td class="name">
  186. <strong translate="no">height</strong>
  187. </td>
  188. <td class="description last">
  189. <p>The width to set.</p>
  190. </td>
  191. </tr>
  192. </tbody>
  193. </table>
  194. </div>
  195. <h2 class="subsection-title">Source</h2>
  196. <p>
  197. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/utils/RTTNode.js" translate="no" target="_blank" rel="noopener">src/nodes/utils/RTTNode.js</a>
  198. </p>
  199. </article>
  200. </section>
  201. <script src="../scripts/linenumber.js"></script>
  202. <script src="../scripts/page.js"></script>
  203. </body>
  204. </html>
粤ICP备19079148号