AfterImageNode.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>AfterImageNode - 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="TempNode.html">TempNode</a> → </p>
  13. <h1 translate="no">AfterImageNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Post processing node for creating an after image effect.</p></div>
  17. </header>
  18. <article>
  19. <h2 class="subsection-title">Import</h2>
  20. <p><span translate="no">AfterImageNode</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
  21. <pre><code class="language-js">import { afterImage } from 'three/addons/tsl/display/AfterImageNode.js';</code></pre>
  22. <div class="container-overview">
  23. <h2>Constructor</h2>
  24. <h3 class="name name-method" id="AfterImageNode" translate="no">new <a href="#AfterImageNode">AfterImageNode</a><span class="signature">( textureNode : <span class="param-type"><a href="TextureNode.html">TextureNode</a></span>, damp : <span class="param-type"><a href="Node.html">Node</a>.&lt;float></span> )</span> </h3>
  25. <div class="method">
  26. <div class="description">
  27. <p>Constructs a new after image node.</p>
  28. </div>
  29. <table class="params">
  30. <tbody>
  31. <tr>
  32. <td class="name">
  33. <strong>textureNode</strong>
  34. </td>
  35. <td class="description last">
  36. <p>The texture node that represents the input of the effect.</p>
  37. </td>
  38. </tr>
  39. <tr>
  40. <td class="name">
  41. <strong>damp</strong>
  42. </td>
  43. <td class="description last">
  44. <p>The damping intensity. A higher value means a stronger after image effect.</p>
  45. <p>Default is <code>0.96</code>.</p>
  46. </td>
  47. </tr>
  48. </tbody>
  49. </table>
  50. </div>
  51. </div>
  52. <h2 class="subsection-title">Properties</h2>
  53. <div class="member">
  54. <h3 class="name" id="damp" translate="no">.<a href="#damp">damp</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;float></span> </h3>
  55. <div class="description">
  56. <p>How quickly the after-image fades. A higher value means the after-image
  57. persists longer, while a lower value means it fades faster. Should be in
  58. the range <code>[0, 1]</code>.</p>
  59. </div>
  60. </div>
  61. <div class="member">
  62. <h3 class="name" id="textureNode" translate="no">.<a href="#textureNode">textureNode</a><span class="type-signature"> : <a href="TextureNode.html">TextureNode</a></span> </h3>
  63. <div class="description">
  64. <p>The texture node that represents the input of the effect.</p>
  65. </div>
  66. </div>
  67. <div class="member">
  68. <h3 class="name" id="updateBeforeType" translate="no">.<a href="#updateBeforeType">updateBeforeType</a><span class="type-signature"> : string</span> </h3>
  69. <div class="description">
  70. <p>The <code>updateBeforeType</code> is set to <code>NodeUpdateType.FRAME</code> since the node renders
  71. its effect once per frame in <code>updateBefore()</code>.</p>
  72. <p>Default is <code>'frame'</code>.</p>
  73. </div>
  74. <dl class="details">
  75. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBeforeType">TempNode#updateBeforeType</a></dt>
  76. </dl>
  77. </div>
  78. <h2 class="subsection-title">Methods</h2>
  79. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  80. <div class="method">
  81. <div class="description">
  82. <p>Frees internal resources. This method should be called
  83. when the effect is no longer required.</p>
  84. </div>
  85. <dl class="details">
  86. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#dispose">TempNode#dispose</a></dt>
  87. </dl>
  88. </div>
  89. <h3 class="name name-method" id="getTextureNode" translate="no">.<a href="#getTextureNode">getTextureNode</a><span class="signature">()</span><span class="type-signature"> : <a href="PassTextureNode.html">PassTextureNode</a></span> </h3>
  90. <div class="method">
  91. <div class="description">
  92. <p>Returns the result of the effect as a texture node.</p>
  93. </div>
  94. <dl class="details">
  95. <dt class="tag-returns"><strong>Returns:</strong> A texture node that represents the result of the effect.</dt>
  96. </dl>
  97. </div>
  98. <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>
  99. <div class="method">
  100. <div class="description">
  101. <p>Sets the size of the effect.</p>
  102. </div>
  103. <table class="params">
  104. <tbody>
  105. <tr>
  106. <td class="name">
  107. <strong>width</strong>
  108. </td>
  109. <td class="description last">
  110. <p>The width of the effect.</p>
  111. </td>
  112. </tr>
  113. <tr>
  114. <td class="name">
  115. <strong>height</strong>
  116. </td>
  117. <td class="description last">
  118. <p>The height of the effect.</p>
  119. </td>
  120. </tr>
  121. </tbody>
  122. </table>
  123. </div>
  124. <h3 class="name name-method" id="setup" translate="no">.<a href="#setup">setup</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : <a href="PassTextureNode.html">PassTextureNode</a></span> </h3>
  125. <div class="method">
  126. <div class="description">
  127. <p>This method is used to setup the effect's TSL code.</p>
  128. </div>
  129. <table class="params">
  130. <tbody>
  131. <tr>
  132. <td class="name">
  133. <strong>builder</strong>
  134. </td>
  135. <td class="description last">
  136. <p>The current node builder.</p>
  137. </td>
  138. </tr>
  139. </tbody>
  140. </table>
  141. <dl class="details">
  142. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#setup">TempNode#setup</a></dt>
  143. </dl>
  144. </div>
  145. <h3 class="name name-method" id="updateBefore" translate="no">.<a href="#updateBefore">updateBefore</a><span class="signature">( frame : <span class="param-type"><a href="NodeFrame.html">NodeFrame</a></span> )</span> </h3>
  146. <div class="method">
  147. <div class="description">
  148. <p>This method is used to render the effect once per frame.</p>
  149. </div>
  150. <table class="params">
  151. <tbody>
  152. <tr>
  153. <td class="name">
  154. <strong>frame</strong>
  155. </td>
  156. <td class="description last">
  157. <p>The current node frame.</p>
  158. </td>
  159. </tr>
  160. </tbody>
  161. </table>
  162. <dl class="details">
  163. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBefore">TempNode#updateBefore</a></dt>
  164. </dl>
  165. </div>
  166. <h2 class="subsection-title">Source</h2>
  167. <p>
  168. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/display/AfterImageNode.js" translate="no" target="_blank" rel="noopener">examples/jsm/tsl/display/AfterImageNode.js</a>
  169. </p>
  170. </article>
  171. </section>
  172. <script src="../scripts/linenumber.js"></script>
  173. <script src="../scripts/page.js"></script>
  174. </body>
  175. </html>
粤ICP备19079148号