AfterImageNode.html 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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">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">TextureNode</span>, damp : <span class="param-type">Node.&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"><code>textureNode</code></td>
  33. <td class="description last"><p>The texture node that represents the input of the effect.</p></td>
  34. </tr>
  35. <tr>
  36. <td class="name"><code>damp</code></td>
  37. <td class="description last"><p>The damping intensity. A higher value means a stronger after image effect.<br/>Default is <code>0.96</code>.</p></td>
  38. </tr>
  39. </tbody>
  40. </table>
  41. </div>
  42. </div>
  43. <h2 class="subsection-title">Properties</h2>
  44. <div class="member">
  45. <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>
  46. <div class="description">
  47. <p>How quickly the after-image fades. A higher value means the after-image
  48. persists longer, while a lower value means it fades faster. Should be in
  49. the range <code>[0, 1]</code>.</p>
  50. </div>
  51. </div>
  52. <div class="member">
  53. <h3 class="name" id="textureNode" translate="no">.<a href="#textureNode">textureNode</a><span class="type-signature"> : <a href="TextureNode.html">TextureNode</a></span> </h3>
  54. <div class="description">
  55. <p>The texture node that represents the input of the effect.</p>
  56. </div>
  57. </div>
  58. <div class="member">
  59. <h3 class="name" id="updateBeforeType" translate="no">.<a href="#updateBeforeType">updateBeforeType</a><span class="type-signature"> : string</span> </h3>
  60. <div class="description">
  61. <p>The <code>updateBeforeType</code> is set to <code>NodeUpdateType.FRAME</code> since the node renders
  62. its effect once per frame in <code>updateBefore()</code>.<br/>Default is <code>'frame'</code>.</p>
  63. </div>
  64. <dl class="details">
  65. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBeforeType">TempNode#updateBeforeType</a></dt>
  66. </dl>
  67. </div>
  68. <h2 class="subsection-title">Methods</h2>
  69. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  70. <div class="method">
  71. <div class="description">
  72. <p>Frees internal resources. This method should be called
  73. when the effect is no longer required.</p>
  74. </div>
  75. <dl class="details">
  76. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#dispose">TempNode#dispose</a></dt>
  77. </dl>
  78. </div>
  79. <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>
  80. <div class="method">
  81. <div class="description">
  82. <p>Returns the result of the effect as a texture node.</p>
  83. </div>
  84. <dl class="details">
  85. <dt class="tag-returns"><strong>Returns:</strong> A texture node that represents the result of the effect.</dt>
  86. </dl>
  87. </div>
  88. <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>
  89. <div class="method">
  90. <div class="description">
  91. <p>Sets the size of the effect.</p>
  92. </div>
  93. <table class="params">
  94. <tbody>
  95. <tr>
  96. <td class="name"><code>width</code></td>
  97. <td class="description last"><p>The width of the effect.</p></td>
  98. </tr>
  99. <tr>
  100. <td class="name"><code>height</code></td>
  101. <td class="description last"><p>The height of the effect.</p></td>
  102. </tr>
  103. </tbody>
  104. </table>
  105. </div>
  106. <h3 class="name name-method" id="setup" translate="no">.<a href="#setup">setup</a><span class="signature">( builder : <span class="param-type">NodeBuilder</span> )</span><span class="type-signature"> : <a href="PassTextureNode.html">PassTextureNode</a></span> </h3>
  107. <div class="method">
  108. <div class="description">
  109. <p>This method is used to setup the effect's TSL code.</p>
  110. </div>
  111. <table class="params">
  112. <tbody>
  113. <tr>
  114. <td class="name"><code>builder</code></td>
  115. <td class="description last"><p>The current node builder.</p></td>
  116. </tr>
  117. </tbody>
  118. </table>
  119. <dl class="details">
  120. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#setup">TempNode#setup</a></dt>
  121. </dl>
  122. <dl class="details">
  123. <dt class="tag-returns"><strong>Returns:</strong> </dt>
  124. </dl>
  125. </div>
  126. <h3 class="name name-method" id="updateBefore" translate="no">.<a href="#updateBefore">updateBefore</a><span class="signature">( frame : <span class="param-type">NodeFrame</span> )</span> </h3>
  127. <div class="method">
  128. <div class="description">
  129. <p>This method is used to render the effect once per frame.</p>
  130. </div>
  131. <table class="params">
  132. <tbody>
  133. <tr>
  134. <td class="name"><code>frame</code></td>
  135. <td class="description last"><p>The current node frame.</p></td>
  136. </tr>
  137. </tbody>
  138. </table>
  139. <dl class="details">
  140. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBefore">TempNode#updateBefore</a></dt>
  141. </dl>
  142. </div>
  143. <h2 class="subsection-title">Source</h2>
  144. <p>
  145. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/display/AfterImageNode.js" target="_blank" rel="noopener" translate="no">examples/jsm/tsl/display/AfterImageNode.js</a>
  146. </p>
  147. </article>
  148. </section>
  149. <script src="../scripts/linenumber.js"></script>
  150. <script src="../scripts/page.js"></script>
  151. </body>
  152. </html>
粤ICP备19079148号