1
0

RTTNode.html 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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>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>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>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>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="pixelRatio" translate="no">.<a href="#pixelRatio">pixelRatio</a><span class="type-signature"> : number</span> </h3>
  107. <div class="description">
  108. <p>The pixel ratio</p>
  109. <p>Default is <code>1</code>.</p>
  110. </div>
  111. </div>
  112. <div class="member">
  113. <h3 class="name" id="renderTarget" translate="no">.<a href="#renderTarget">renderTarget</a><span class="type-signature"> : <a href="RenderTarget.html">RenderTarget</a></span> </h3>
  114. <div class="description">
  115. <p>The render target</p>
  116. </div>
  117. </div>
  118. <div class="member">
  119. <h3 class="name" id="textureNeedsUpdate" translate="no">.<a href="#textureNeedsUpdate">textureNeedsUpdate</a><span class="type-signature"> : boolean</span> </h3>
  120. <div class="description">
  121. <p>Whether the texture requires an update or not.</p>
  122. <p>Default is <code>true</code>.</p>
  123. </div>
  124. </div>
  125. <div class="member">
  126. <h3 class="name" id="updateBeforeType" translate="no">.<a href="#updateBeforeType">updateBeforeType</a><span class="type-signature"> : string</span> </h3>
  127. <div class="description">
  128. <p>The <code>updateBeforeType</code> is set to <code>NodeUpdateType.RENDER</code> since the node updates
  129. the texture once per render in its <a href="RTTNode.html#updateBefore">RTTNode#updateBefore</a> method.</p>
  130. <p>Default is <code>'render'</code>.</p>
  131. </div>
  132. <dl class="details">
  133. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TextureNode.html#updateBeforeType">TextureNode#updateBeforeType</a></dt>
  134. </dl>
  135. </div>
  136. <div class="member">
  137. <h3 class="name" id="width" translate="no">.<a href="#width">width</a><span class="type-signature"> : number</span> </h3>
  138. <div class="description">
  139. <p>The width of the internal render target.
  140. If not width is applied, the render target is automatically resized.</p>
  141. <p>Default is <code>null</code>.</p>
  142. </div>
  143. </div>
  144. <h2 class="subsection-title">Methods</h2>
  145. <h3 class="name name-method" id="setPixelRatio" translate="no">.<a href="#setPixelRatio">setPixelRatio</a><span class="signature">( pixelRatio : <span class="param-type">number</span> )</span> </h3>
  146. <div class="method">
  147. <div class="description">
  148. <p>Sets the pixel ratio. This will also resize the render target.</p>
  149. </div>
  150. <table class="params">
  151. <tbody>
  152. <tr>
  153. <td class="name">
  154. <strong>pixelRatio</strong>
  155. </td>
  156. <td class="description last">
  157. <p>The pixel ratio to set.</p>
  158. </td>
  159. </tr>
  160. </tbody>
  161. </table>
  162. </div>
  163. <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>
  164. <div class="method">
  165. <div class="description">
  166. <p>Sets the size of the internal render target</p>
  167. </div>
  168. <table class="params">
  169. <tbody>
  170. <tr>
  171. <td class="name">
  172. <strong>width</strong>
  173. </td>
  174. <td class="description last">
  175. <p>The width to set.</p>
  176. </td>
  177. </tr>
  178. <tr>
  179. <td class="name">
  180. <strong>height</strong>
  181. </td>
  182. <td class="description last">
  183. <p>The width to set.</p>
  184. </td>
  185. </tr>
  186. </tbody>
  187. </table>
  188. </div>
  189. <h2 class="subsection-title">Source</h2>
  190. <p>
  191. <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>
  192. </p>
  193. </article>
  194. </section>
  195. <script src="../scripts/linenumber.js"></script>
  196. <script src="../scripts/page.js"></script>
  197. </body>
  198. </html>
粤ICP备19079148号