TAARenderPass.html 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>TAARenderPass - 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> → <a href="SSAARenderPass.html">SSAARenderPass</a> → </p>
  13. <h1 translate="no">TAARenderPass</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Temporal Anti-Aliasing Render Pass.</p>
  17. <p>When there is no motion in the scene, the TAA render pass accumulates jittered camera
  18. samples across frames to create a high quality anti-aliased result.</p>
  19. <p>Note: This effect uses no reprojection so it is no TRAA implementation.</p></div>
  20. <h2>Code Example</h2>
  21. <div translate="no"><pre><code class="language-js">const taaRenderPass = new TAARenderPass( scene, camera );
  22. taaRenderPass.unbiased = false;
  23. composer.addPass( taaRenderPass );
  24. </code></pre></div>
  25. </header>
  26. <article>
  27. <h2 class="subsection-title">Import</h2>
  28. <p><span translate="no">TAARenderPass</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>
  29. <pre><code class="language-js">import { TAARenderPass } from 'three/addons/postprocessing/TAARenderPass.js';</code></pre>
  30. <div class="container-overview">
  31. <h2>Constructor</h2>
  32. <h3 class="name name-method" id="TAARenderPass" translate="no">new <a href="#TAARenderPass">TAARenderPass</a><span class="signature">( scene : <span class="param-type"><a href="Scene.html">Scene</a></span>, camera : <span class="param-type"><a href="Camera.html">Camera</a></span>, clearColor : <span class="param-type">number | <a href="Color.html">Color</a> | string</span>, clearAlpha : <span class="param-type">number</span> )</span> </h3>
  33. <div class="method">
  34. <div class="description">
  35. <p>Constructs a new TAA render pass.</p>
  36. </div>
  37. <table class="params">
  38. <tbody>
  39. <tr>
  40. <td class="name">
  41. <strong>scene</strong>
  42. </td>
  43. <td class="description last">
  44. <p>The scene to render.</p>
  45. </td>
  46. </tr>
  47. <tr>
  48. <td class="name">
  49. <strong>camera</strong>
  50. </td>
  51. <td class="description last">
  52. <p>The camera.</p>
  53. </td>
  54. </tr>
  55. <tr>
  56. <td class="name">
  57. <strong>clearColor</strong>
  58. </td>
  59. <td class="description last">
  60. <p>The clear color of the render pass.</p>
  61. <p>Default is <code>0x000000</code>.</p>
  62. </td>
  63. </tr>
  64. <tr>
  65. <td class="name">
  66. <strong>clearAlpha</strong>
  67. </td>
  68. <td class="description last">
  69. <p>The clear alpha of the render pass.</p>
  70. <p>Default is <code>0</code>.</p>
  71. </td>
  72. </tr>
  73. </tbody>
  74. </table>
  75. </div>
  76. </div>
  77. <h2 class="subsection-title">Properties</h2>
  78. <div class="member">
  79. <h3 class="name" id="accumulate" translate="no">.<a href="#accumulate">accumulate</a><span class="type-signature"> : boolean</span> </h3>
  80. <div class="description">
  81. <p>Whether to accumulate frames or not. This enables
  82. the TAA.</p>
  83. <p>Default is <code>false</code>.</p>
  84. </div>
  85. </div>
  86. <div class="member">
  87. <h3 class="name" id="accumulateIndex" translate="no">.<a href="#accumulateIndex">accumulateIndex</a><span class="type-signature"> : number</span> </h3>
  88. <div class="description">
  89. <p>The accumulation index.</p>
  90. <p>Default is <code>-1</code>.</p>
  91. </div>
  92. </div>
  93. <div class="member">
  94. <h3 class="name" id="sampleLevel" translate="no">.<a href="#sampleLevel">sampleLevel</a><span class="type-signature"> : number</span> </h3>
  95. <div class="description">
  96. <p>Overwritten and set to 0 by default.</p>
  97. <p>Default is <code>0</code>.</p>
  98. </div>
  99. <dl class="details">
  100. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="SSAARenderPass.html#sampleLevel">SSAARenderPass#sampleLevel</a></dt>
  101. </dl>
  102. </div>
  103. <h2 class="subsection-title">Methods</h2>
  104. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  105. <div class="method">
  106. <div class="description">
  107. <p>Frees the GPU-related resources allocated by this instance. Call this
  108. method whenever the pass is no longer used in your app.</p>
  109. </div>
  110. <dl class="details">
  111. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="SSAARenderPass.html#dispose">SSAARenderPass#dispose</a></dt>
  112. </dl>
  113. </div>
  114. <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>
  115. <div class="method">
  116. <div class="description">
  117. <p>Performs the TAA render pass.</p>
  118. </div>
  119. <table class="params">
  120. <tbody>
  121. <tr>
  122. <td class="name">
  123. <strong>renderer</strong>
  124. </td>
  125. <td class="description last">
  126. <p>The renderer.</p>
  127. </td>
  128. </tr>
  129. <tr>
  130. <td class="name">
  131. <strong>writeBuffer</strong>
  132. </td>
  133. <td class="description last">
  134. <p>The write buffer. This buffer is intended as the rendering
  135. destination for the pass.</p>
  136. </td>
  137. </tr>
  138. <tr>
  139. <td class="name">
  140. <strong>readBuffer</strong>
  141. </td>
  142. <td class="description last">
  143. <p>The read buffer. The pass can access the result from the
  144. previous pass from this buffer.</p>
  145. </td>
  146. </tr>
  147. <tr>
  148. <td class="name">
  149. <strong>deltaTime</strong>
  150. </td>
  151. <td class="description last">
  152. <p>The delta time in seconds.</p>
  153. </td>
  154. </tr>
  155. <tr>
  156. <td class="name">
  157. <strong>maskActive</strong>
  158. </td>
  159. <td class="description last">
  160. <p>Whether masking is active or not.</p>
  161. </td>
  162. </tr>
  163. </tbody>
  164. </table>
  165. <dl class="details">
  166. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="SSAARenderPass.html#render">SSAARenderPass#render</a></dt>
  167. </dl>
  168. </div>
  169. <h2 class="subsection-title">Source</h2>
  170. <p>
  171. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/postprocessing/TAARenderPass.js" translate="no" target="_blank" rel="noopener">examples/jsm/postprocessing/TAARenderPass.js</a>
  172. </p>
  173. </article>
  174. </section>
  175. <script src="../scripts/linenumber.js"></script>
  176. <script src="../scripts/page.js"></script>
  177. </body>
  178. </html>
粤ICP备19079148号