AfterimagePass.html 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>AfterimagePass - 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="Pass.html">Pass</a> → </p>
  13. <h1 translate="no">AfterimagePass</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Pass for a basic after image effect.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const afterimagePass = new AfterimagePass( 0.9 );
  19. composer.addPass( afterimagePass );
  20. </code></pre></div>
  21. </header>
  22. <article>
  23. <h2 class="subsection-title">Import</h2>
  24. <p><span translate="no">AfterimagePass</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>
  25. <pre><code class="language-js">import { AfterimagePass } from 'three/addons/postprocessing/AfterimagePass.js';</code></pre>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="AfterimagePass" translate="no">new <a href="#AfterimagePass">AfterimagePass</a><span class="signature">( damp : <span class="param-type">number</span> )</span> </h3>
  29. <div class="method">
  30. <div class="description">
  31. <p>Constructs a new after image pass.</p>
  32. </div>
  33. <table class="params">
  34. <tbody>
  35. <tr>
  36. <td class="name">
  37. <strong>damp</strong>
  38. </td>
  39. <td class="description last">
  40. <p>The damping intensity. A higher value means a stronger after image effect.</p>
  41. <p>Default is <code>0.96</code>.</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="compFsMaterial" translate="no">.<a href="#compFsMaterial">compFsMaterial</a><span class="type-signature"> : <a href="ShaderMaterial.html">ShaderMaterial</a></span> </h3>
  51. <div class="description">
  52. <p>The composition material.</p>
  53. </div>
  54. </div>
  55. <div class="member">
  56. <h3 class="name" id="copyFsMaterial" translate="no">.<a href="#copyFsMaterial">copyFsMaterial</a><span class="type-signature"> : <a href="ShaderMaterial.html">ShaderMaterial</a></span> </h3>
  57. <div class="description">
  58. <p>The copy material.</p>
  59. </div>
  60. </div>
  61. <div class="member">
  62. <h3 class="name" id="damp" translate="no">.<a href="#damp">damp</a><span class="type-signature"> : number</span> </h3>
  63. <div class="description">
  64. <p>The damping intensity, from 0.0 to 1.0. A higher value means a stronger after image effect.</p>
  65. </div>
  66. </div>
  67. <div class="member">
  68. <h3 class="name" id="uniforms" translate="no">.<a href="#uniforms">uniforms</a><span class="type-signature"> : Object</span> </h3>
  69. <div class="description">
  70. <p>The pass uniforms. Use this object if you want to update the
  71. <code>damp</code> value at runtime.</p>
  72. <pre><code class="language-js">pass.uniforms.damp.value = 0.9;
  73. </code></pre>
  74. </div>
  75. </div>
  76. <h2 class="subsection-title">Methods</h2>
  77. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  78. <div class="method">
  79. <div class="description">
  80. <p>Frees the GPU-related resources allocated by this instance. Call this
  81. method whenever the pass is no longer used in your app.</p>
  82. </div>
  83. <dl class="details">
  84. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#dispose">Pass#dispose</a></dt>
  85. </dl>
  86. </div>
  87. <h3 class="name name-method" id="render" translate="no">.<a href="#render">render</a><span class="signature">( renderer : <span class="param-type"><a href="WebGLRenderer.html">WebGLRenderer</a></span>, writeBuffer : <span class="param-type"><a href="WebGLRenderTarget.html">WebGLRenderTarget</a></span>, readBuffer : <span class="param-type"><a href="WebGLRenderTarget.html">WebGLRenderTarget</a></span>, deltaTime : <span class="param-type">number</span>, maskActive : <span class="param-type">boolean</span> )</span> </h3>
  88. <div class="method">
  89. <div class="description">
  90. <p>Performs the after image pass.</p>
  91. </div>
  92. <table class="params">
  93. <tbody>
  94. <tr>
  95. <td class="name">
  96. <strong>renderer</strong>
  97. </td>
  98. <td class="description last">
  99. <p>The renderer.</p>
  100. </td>
  101. </tr>
  102. <tr>
  103. <td class="name">
  104. <strong>writeBuffer</strong>
  105. </td>
  106. <td class="description last">
  107. <p>The write buffer. This buffer is intended as the rendering
  108. destination for the pass.</p>
  109. </td>
  110. </tr>
  111. <tr>
  112. <td class="name">
  113. <strong>readBuffer</strong>
  114. </td>
  115. <td class="description last">
  116. <p>The read buffer. The pass can access the result from the
  117. previous pass from this buffer.</p>
  118. </td>
  119. </tr>
  120. <tr>
  121. <td class="name">
  122. <strong>deltaTime</strong>
  123. </td>
  124. <td class="description last">
  125. <p>The delta time in seconds.</p>
  126. </td>
  127. </tr>
  128. <tr>
  129. <td class="name">
  130. <strong>maskActive</strong>
  131. </td>
  132. <td class="description last">
  133. <p>Whether masking is active or not.</p>
  134. </td>
  135. </tr>
  136. </tbody>
  137. </table>
  138. <dl class="details">
  139. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#render">Pass#render</a></dt>
  140. </dl>
  141. </div>
  142. <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>
  143. <div class="method">
  144. <div class="description">
  145. <p>Sets the size of the pass.</p>
  146. </div>
  147. <table class="params">
  148. <tbody>
  149. <tr>
  150. <td class="name">
  151. <strong>width</strong>
  152. </td>
  153. <td class="description last">
  154. <p>The width to set.</p>
  155. </td>
  156. </tr>
  157. <tr>
  158. <td class="name">
  159. <strong>height</strong>
  160. </td>
  161. <td class="description last">
  162. <p>The height to set.</p>
  163. </td>
  164. </tr>
  165. </tbody>
  166. </table>
  167. <dl class="details">
  168. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#setSize">Pass#setSize</a></dt>
  169. </dl>
  170. </div>
  171. <h2 class="subsection-title">Source</h2>
  172. <p>
  173. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/postprocessing/AfterimagePass.js" translate="no" target="_blank" rel="noopener">examples/jsm/postprocessing/AfterimagePass.js</a>
  174. </p>
  175. </article>
  176. </section>
  177. <script src="../scripts/linenumber.js"></script>
  178. <script src="../scripts/page.js"></script>
  179. </body>
  180. </html>
粤ICP备19079148号