SMAAPass.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>SMAAPass - 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">SMAAPass</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A pass for applying SMAA. Unlike <a href="FXAAPass.html">FXAAPass</a>, <code>SMAAPass</code> operates in
  17. <code>linear-srgb</code> so this pass must be executed before <a href="OutputPass.html">OutputPass</a>.</p></div>
  18. <h2>Code Example</h2>
  19. <div translate="no"><pre><code class="language-js">const smaaPass = new SMAAPass();
  20. composer.addPass( smaaPass );
  21. </code></pre></div>
  22. </header>
  23. <article>
  24. <h2 class="subsection-title">Import</h2>
  25. <p><span translate="no">SMAAPass</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>
  26. <pre><code class="language-js">import { SMAAPass } from 'three/addons/postprocessing/SMAAPass.js';</code></pre>
  27. <div class="container-overview">
  28. <h2>Constructor</h2>
  29. <h3 class="name name-method" id="SMAAPass" translate="no">new <a href="#SMAAPass">SMAAPass</a><span class="signature">()</span> </h3>
  30. <div class="method">
  31. <div class="description">
  32. <p>Constructs a new SMAA pass.</p>
  33. </div>
  34. </div>
  35. </div>
  36. <h2 class="subsection-title">Methods</h2>
  37. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  38. <div class="method">
  39. <div class="description">
  40. <p>Frees the GPU-related resources allocated by this instance. Call this
  41. method whenever the pass is no longer used in your app.</p>
  42. </div>
  43. <dl class="details">
  44. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#dispose">Pass#dispose</a></dt>
  45. </dl>
  46. </div>
  47. <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>
  48. <div class="method">
  49. <div class="description">
  50. <p>Performs the SMAA pass.</p>
  51. </div>
  52. <table class="params">
  53. <tbody>
  54. <tr>
  55. <td class="name">
  56. <strong>renderer</strong>
  57. </td>
  58. <td class="description last">
  59. <p>The renderer.</p>
  60. </td>
  61. </tr>
  62. <tr>
  63. <td class="name">
  64. <strong>writeBuffer</strong>
  65. </td>
  66. <td class="description last">
  67. <p>The write buffer. This buffer is intended as the rendering
  68. destination for the pass.</p>
  69. </td>
  70. </tr>
  71. <tr>
  72. <td class="name">
  73. <strong>readBuffer</strong>
  74. </td>
  75. <td class="description last">
  76. <p>The read buffer. The pass can access the result from the
  77. previous pass from this buffer.</p>
  78. </td>
  79. </tr>
  80. <tr>
  81. <td class="name">
  82. <strong>deltaTime</strong>
  83. </td>
  84. <td class="description last">
  85. <p>The delta time in seconds.</p>
  86. </td>
  87. </tr>
  88. <tr>
  89. <td class="name">
  90. <strong>maskActive</strong>
  91. </td>
  92. <td class="description last">
  93. <p>Whether masking is active or not.</p>
  94. </td>
  95. </tr>
  96. </tbody>
  97. </table>
  98. <dl class="details">
  99. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#render">Pass#render</a></dt>
  100. </dl>
  101. </div>
  102. <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>
  103. <div class="method">
  104. <div class="description">
  105. <p>Sets the size of the pass.</p>
  106. </div>
  107. <table class="params">
  108. <tbody>
  109. <tr>
  110. <td class="name">
  111. <strong>width</strong>
  112. </td>
  113. <td class="description last">
  114. <p>The width to set.</p>
  115. </td>
  116. </tr>
  117. <tr>
  118. <td class="name">
  119. <strong>height</strong>
  120. </td>
  121. <td class="description last">
  122. <p>The height to set.</p>
  123. </td>
  124. </tr>
  125. </tbody>
  126. </table>
  127. <dl class="details">
  128. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#setSize">Pass#setSize</a></dt>
  129. </dl>
  130. </div>
  131. <h2 class="subsection-title">Source</h2>
  132. <p>
  133. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/postprocessing/SMAAPass.js" translate="no" target="_blank" rel="noopener">examples/jsm/postprocessing/SMAAPass.js</a>
  134. </p>
  135. </article>
  136. </section>
  137. <script src="../scripts/linenumber.js"></script>
  138. <script src="../scripts/page.js"></script>
  139. </body>
  140. </html>
粤ICP备19079148号