| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>SSAAPassNode - Three.js Docs</title>
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <script src="../scripts/highlight.min.js"></script>
- <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
- <link type="text/css" rel="stylesheet" href="../styles/page.css">
- </head>
- <body>
- <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>
- <h1 translate="no">SSAAPassNode</h1>
- <section>
- <header>
- <div class="class-description"><p>A special render pass node that renders the scene with SSAA (Supersampling Anti-Aliasing).
- This manual SSAA approach re-renders the scene ones for each sample with camera jitter and accumulates the results.</p>
- <p>This node produces a high-quality anti-aliased output but is also extremely expensive because of
- its brute-force approach of re-rendering the entire scene multiple times.</p>
- <p>Reference: <a href="https://en.wikipedia.org/wiki/Supersampling" target="_blank" rel="noopener">https://en.wikipedia.org/wiki/Supersampling</a></p></div>
- </header>
- <article>
- <h2 class="subsection-title">Import</h2>
- <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" rel="noopener">Installation#Addons</a>.</p>
- <pre><code class="language-js">import { ssaaPass } from 'three/addons/tsl/display/SSAAPassNode.js';</code></pre>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="SSAAPassNode" translate="no">new <a href="#SSAAPassNode">SSAAPassNode</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> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Constructs a new SSAA pass node.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>scene</strong>
- </td>
- <td class="description last">
- <p>The scene to render.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>camera</strong>
- </td>
- <td class="description last">
- <p>The camera to render the scene with.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <h2 class="subsection-title">Properties</h2>
- <div class="member">
- <h3 class="name" id="clearAlpha" translate="no">.<a href="#clearAlpha">clearAlpha</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The clear alpha of the pass.</p>
- <p>Default is <code>0</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="clearColor" translate="no">.<a href="#clearColor">clearColor</a><span class="type-signature"> : <a href="Color.html">Color</a></span> </h3>
- <div class="description">
- <p>The clear color of the pass.</p>
- <p>Default is <code>0x000000</code>.</p>
- </div>
- </div>
- <div class="member">
- <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>
- <div class="description">
- <p>This flag can be used for type testing.</p>
- <p>Default is <code>true</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="sampleLevel" translate="no">.<a href="#sampleLevel">sampleLevel</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The sample level specified as n, where the number of samples is 2^n,
- so sampleLevel = 4, is 2^4 samples, 16.</p>
- <p>Default is <code>4</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="sampleWeight" translate="no">.<a href="#sampleWeight">sampleWeight</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.<float></span> </h3>
- <div class="description">
- <p>A uniform node representing the sample weight.</p>
- <p>Default is <code>1</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="unbiased" translate="no">.<a href="#unbiased">unbiased</a><span class="type-signature"> : boolean</span> </h3>
- <div class="description">
- <p>Whether rounding errors should be mitigated or not.</p>
- <p>Default is <code>true</code>.</p>
- </div>
- </div>
- <h2 class="subsection-title">Methods</h2>
- <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
- <div class="method">
- <div class="description">
- <p>Frees internal resources. This method should be called
- when the pass is no longer required.</p>
- </div>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="PassNode.html#dispose">PassNode#dispose</a></dt>
- </dl>
- </div>
- <h3 class="name name-method" id="setup" translate="no">.<a href="#setup">setup</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : <a href="PassTextureNode.html">PassTextureNode</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>This method is used to setup the effect's MRT configuration and quad mesh.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>builder</strong>
- </td>
- <td class="description last">
- <p>The current node builder.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="PassNode.html#setup">PassNode#setup</a></dt>
- </dl>
- </div>
- <h3 class="name name-method" id="updateBefore" translate="no">.<a href="#updateBefore">updateBefore</a><span class="signature">( frame : <span class="param-type"><a href="NodeFrame.html">NodeFrame</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>This method is used to render the SSAA effect once per frame.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>frame</strong>
- </td>
- <td class="description last">
- <p>The current node frame.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="PassNode.html#updateBefore">PassNode#updateBefore</a></dt>
- </dl>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/display/SSAAPassNode.js" translate="no" target="_blank" rel="noopener">examples/jsm/tsl/display/SSAAPassNode.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|