AfterimagePass.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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">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"><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="compFsMaterial" translate="no">.<a href="#compFsMaterial">compFsMaterial</a><span class="type-signature"> : <a href="ShaderMaterial.html">ShaderMaterial</a></span> </h3>
  46. <div class="description">
  47. <p>The composition material.</p>
  48. </div>
  49. </div>
  50. <div class="member">
  51. <h3 class="name" id="copyFsMaterial" translate="no">.<a href="#copyFsMaterial">copyFsMaterial</a><span class="type-signature"> : <a href="ShaderMaterial.html">ShaderMaterial</a></span> </h3>
  52. <div class="description">
  53. <p>The copy material.</p>
  54. </div>
  55. </div>
  56. <div class="member">
  57. <h3 class="name" id="damp" translate="no">.<a href="#damp">damp</a><span class="type-signature"> : number</span> </h3>
  58. <div class="description">
  59. <p>The damping intensity, from 0.0 to 1.0. A higher value means a stronger after image effect.</p>
  60. </div>
  61. </div>
  62. <div class="member">
  63. <h3 class="name" id="uniforms" translate="no">.<a href="#uniforms">uniforms</a><span class="type-signature"> : Object</span> </h3>
  64. <div class="description">
  65. <p>The pass uniforms. Use this object if you want to update the
  66. <code>damp</code> value at runtime.</p>
  67. <pre><code class="language-js">pass.uniforms.damp.value = 0.9;
  68. </code></pre>
  69. </div>
  70. </div>
  71. <h2 class="subsection-title">Methods</h2>
  72. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  73. <div class="method">
  74. <div class="description">
  75. <p>Frees the GPU-related resources allocated by this instance. Call this
  76. method whenever the pass is no longer used in your app.</p>
  77. </div>
  78. <dl class="details">
  79. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#dispose">Pass#dispose</a></dt>
  80. </dl>
  81. </div>
  82. <h3 class="name name-method" id="render" translate="no">.<a href="#render">render</a><span class="signature">( renderer : <span class="param-type">WebGLRenderer</span>, writeBuffer : <span class="param-type">WebGLRenderTarget</span>, readBuffer : <span class="param-type">WebGLRenderTarget</span>, deltaTime : <span class="param-type">number</span>, maskActive : <span class="param-type">boolean</span> )</span> </h3>
  83. <div class="method">
  84. <div class="description">
  85. <p>Performs the after image pass.</p>
  86. </div>
  87. <table class="params">
  88. <tbody>
  89. <tr>
  90. <td class="name"><code>renderer</code></td>
  91. <td class="description last"><p>The renderer.</p></td>
  92. </tr>
  93. <tr>
  94. <td class="name"><code>writeBuffer</code></td>
  95. <td class="description last"><p>The write buffer. This buffer is intended as the rendering
  96. destination for the pass.</p></td>
  97. </tr>
  98. <tr>
  99. <td class="name"><code>readBuffer</code></td>
  100. <td class="description last"><p>The read buffer. The pass can access the result from the
  101. previous pass from this buffer.</p></td>
  102. </tr>
  103. <tr>
  104. <td class="name"><code>deltaTime</code></td>
  105. <td class="description last"><p>The delta time in seconds.</p></td>
  106. </tr>
  107. <tr>
  108. <td class="name"><code>maskActive</code></td>
  109. <td class="description last"><p>Whether masking is active or not.</p></td>
  110. </tr>
  111. </tbody>
  112. </table>
  113. <dl class="details">
  114. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#render">Pass#render</a></dt>
  115. </dl>
  116. </div>
  117. <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>
  118. <div class="method">
  119. <div class="description">
  120. <p>Sets the size of the pass.</p>
  121. </div>
  122. <table class="params">
  123. <tbody>
  124. <tr>
  125. <td class="name"><code>width</code></td>
  126. <td class="description last"><p>The width to set.</p></td>
  127. </tr>
  128. <tr>
  129. <td class="name"><code>height</code></td>
  130. <td class="description last"><p>The height to set.</p></td>
  131. </tr>
  132. </tbody>
  133. </table>
  134. <dl class="details">
  135. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#setSize">Pass#setSize</a></dt>
  136. </dl>
  137. </div>
  138. <h2 class="subsection-title">Source</h2>
  139. <p>
  140. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/postprocessing/AfterimagePass.js" target="_blank" rel="noopener" translate="no">examples/jsm/postprocessing/AfterimagePass.js</a>
  141. </p>
  142. </article>
  143. </section>
  144. <script src="../scripts/linenumber.js"></script>
  145. <script src="../scripts/page.js"></script>
  146. </body>
  147. </html>
粤ICP备19079148号