SSAAPassNode.html 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>SSAAPassNode - 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="EventDispatcher.html">EventDispatcher</a> → <a href="Node.html">Node</a> → <a href="TempNode.html">TempNode</a> → <a href="PassNode.html">PassNode</a> → </p>
  13. <h1 translate="no">SSAAPassNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A special render pass node that renders the scene with SSAA (Supersampling Anti-Aliasing).
  17. This manual SSAA approach re-renders the scene ones for each sample with camera jitter and accumulates the results.</p>
  18. <p>This node produces a high-quality anti-aliased output but is also extremely expensive because of
  19. its brute-force approach of re-rendering the entire scene multiple times.</p>
  20. <p>Reference: <a href="https://en.wikipedia.org/wiki/Supersampling">https://en.wikipedia.org/wiki/Supersampling</a></p></div>
  21. </header>
  22. <article>
  23. <h2 class="subsection-title">Import</h2>
  24. <p><span translate="no">SSAAPassNode</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 { ssaaPass } from 'three/addons/tsl/display/SSAAPassNode.js';</code></pre>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="SSAAPassNode" translate="no">new <a href="#SSAAPassNode">SSAAPassNode</a><span class="signature">( scene : <span class="param-type">Scene</span>, camera : <span class="param-type">Camera</span> )</span> </h3>
  29. <div class="method">
  30. <div class="description">
  31. <p>Constructs a new SSAA pass node.</p>
  32. </div>
  33. <table class="params">
  34. <tbody>
  35. <tr>
  36. <td class="name"><code>scene</code></td>
  37. <td class="description last"><p>The scene to render.</p></td>
  38. </tr>
  39. <tr>
  40. <td class="name"><code>camera</code></td>
  41. <td class="description last"><p>The camera to render the scene with.</p></td>
  42. </tr>
  43. </tbody>
  44. </table>
  45. </div>
  46. </div>
  47. <h2 class="subsection-title">Properties</h2>
  48. <div class="member">
  49. <h3 class="name" id="clearAlpha" translate="no">.<a href="#clearAlpha">clearAlpha</a><span class="type-signature"> : number</span> </h3>
  50. <div class="description">
  51. <p>The clear alpha of the pass.<br/>Default is <code>0</code>.</p>
  52. </div>
  53. </div>
  54. <div class="member">
  55. <h3 class="name" id="clearColor" translate="no">.<a href="#clearColor">clearColor</a><span class="type-signature"> : <a href="Color.html">Color</a></span> </h3>
  56. <div class="description">
  57. <p>The clear color of the pass.<br/>Default is <code>0x000000</code>.</p>
  58. </div>
  59. </div>
  60. <div class="member">
  61. <h3 class="name" id="isSSAAPassNode" translate="no">.<a href="#isSSAAPassNode">isSSAAPassNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  62. <div class="description">
  63. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  64. </div>
  65. </div>
  66. <div class="member">
  67. <h3 class="name" id="sampleLevel" translate="no">.<a href="#sampleLevel">sampleLevel</a><span class="type-signature"> : number</span> </h3>
  68. <div class="description">
  69. <p>The sample level specified as n, where the number of samples is 2^n,
  70. so sampleLevel = 4, is 2^4 samples, 16.<br/>Default is <code>4</code>.</p>
  71. </div>
  72. </div>
  73. <div class="member">
  74. <h3 class="name" id="sampleWeight" translate="no">.<a href="#sampleWeight">sampleWeight</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;float></span> </h3>
  75. <div class="description">
  76. <p>A uniform node representing the sample weight.<br/>Default is <code>1</code>.</p>
  77. </div>
  78. </div>
  79. <div class="member">
  80. <h3 class="name" id="unbiased" translate="no">.<a href="#unbiased">unbiased</a><span class="type-signature"> : boolean</span> </h3>
  81. <div class="description">
  82. <p>Whether rounding errors should be mitigated or not.<br/>Default is <code>true</code>.</p>
  83. </div>
  84. </div>
  85. <h2 class="subsection-title">Methods</h2>
  86. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  87. <div class="method">
  88. <div class="description">
  89. <p>Frees internal resources. This method should be called
  90. when the pass is no longer required.</p>
  91. </div>
  92. <dl class="details">
  93. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="PassNode.html#dispose">PassNode#dispose</a></dt>
  94. </dl>
  95. </div>
  96. <h3 class="name name-method" id="setup" translate="no">.<a href="#setup">setup</a><span class="signature">( builder : <span class="param-type">NodeBuilder</span> )</span><span class="type-signature"> : <a href="PassTextureNode.html">PassTextureNode</a></span> </h3>
  97. <div class="method">
  98. <div class="description">
  99. <p>This method is used to setup the effect's MRT configuration and quad mesh.</p>
  100. </div>
  101. <table class="params">
  102. <tbody>
  103. <tr>
  104. <td class="name"><code>builder</code></td>
  105. <td class="description last"><p>The current node builder.</p></td>
  106. </tr>
  107. </tbody>
  108. </table>
  109. <dl class="details">
  110. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="PassNode.html#setup">PassNode#setup</a></dt>
  111. </dl>
  112. <dl class="details">
  113. <dt class="tag-returns"><strong>Returns:</strong> </dt>
  114. </dl>
  115. </div>
  116. <h3 class="name name-method" id="updateBefore" translate="no">.<a href="#updateBefore">updateBefore</a><span class="signature">( frame : <span class="param-type">NodeFrame</span> )</span> </h3>
  117. <div class="method">
  118. <div class="description">
  119. <p>This method is used to render the SSAA effect once per frame.</p>
  120. </div>
  121. <table class="params">
  122. <tbody>
  123. <tr>
  124. <td class="name"><code>frame</code></td>
  125. <td class="description last"><p>The current node frame.</p></td>
  126. </tr>
  127. </tbody>
  128. </table>
  129. <dl class="details">
  130. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="PassNode.html#updateBefore">PassNode#updateBefore</a></dt>
  131. </dl>
  132. </div>
  133. <h2 class="subsection-title">Source</h2>
  134. <p>
  135. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/display/SSAAPassNode.js" target="_blank" rel="noopener" translate="no">examples/jsm/tsl/display/SSAAPassNode.js</a>
  136. </p>
  137. </article>
  138. </section>
  139. <script src="../scripts/linenumber.js"></script>
  140. <script src="../scripts/page.js"></script>
  141. </body>
  142. </html>
粤ICP备19079148号