SMAAPass.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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">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">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>
  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"><code>renderer</code></td>
  56. <td class="description last"><p>The renderer.</p></td>
  57. </tr>
  58. <tr>
  59. <td class="name"><code>writeBuffer</code></td>
  60. <td class="description last"><p>The write buffer. This buffer is intended as the rendering
  61. destination for the pass.</p></td>
  62. </tr>
  63. <tr>
  64. <td class="name"><code>readBuffer</code></td>
  65. <td class="description last"><p>The read buffer. The pass can access the result from the
  66. previous pass from this buffer.</p></td>
  67. </tr>
  68. <tr>
  69. <td class="name"><code>deltaTime</code></td>
  70. <td class="description last"><p>The delta time in seconds.</p></td>
  71. </tr>
  72. <tr>
  73. <td class="name"><code>maskActive</code></td>
  74. <td class="description last"><p>Whether masking is active or not.</p></td>
  75. </tr>
  76. </tbody>
  77. </table>
  78. <dl class="details">
  79. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#render">Pass#render</a></dt>
  80. </dl>
  81. </div>
  82. <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>
  83. <div class="method">
  84. <div class="description">
  85. <p>Sets the size of the pass.</p>
  86. </div>
  87. <table class="params">
  88. <tbody>
  89. <tr>
  90. <td class="name"><code>width</code></td>
  91. <td class="description last"><p>The width to set.</p></td>
  92. </tr>
  93. <tr>
  94. <td class="name"><code>height</code></td>
  95. <td class="description last"><p>The height to set.</p></td>
  96. </tr>
  97. </tbody>
  98. </table>
  99. <dl class="details">
  100. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#setSize">Pass#setSize</a></dt>
  101. </dl>
  102. </div>
  103. <h2 class="subsection-title">Source</h2>
  104. <p>
  105. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/postprocessing/SMAAPass.js" target="_blank" rel="noopener" translate="no">examples/jsm/postprocessing/SMAAPass.js</a>
  106. </p>
  107. </article>
  108. </section>
  109. <script src="../scripts/linenumber.js"></script>
  110. <script src="../scripts/page.js"></script>
  111. </body>
  112. </html>
粤ICP备19079148号