| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>TAAUNode - 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> → </p>
- <h1 translate="no">TAAUNode</h1>
- <section>
- <header>
- <div class="class-description"><p>A special node that performs Temporal Anti-Aliasing Upscaling (TAAU).</p>
- <p>Like TRAA, the node accumulates jittered samples over multiple frames and
- reprojects history with motion vectors. Unlike TRAA, the input buffers
- (beauty, depth, velocity) are expected to be rendered at a lower resolution
- than the renderer's drawing buffer — typically by lowering the upstream
- pass's resolution via <a href="PassNode.html#setResolutionScale">PassNode#setResolutionScale</a> — and the resolve
- pass reconstructs an output-resolution image using a 9-tap Blackman-Harris
- filter (Gaussian approximation) over the jittered input samples. The result
- is an alternative to FSR2/3 that does anti-aliasing and upscaling in a
- single pass.</p>
- <p>References:</p>
- <ul>
- <li>Karis, "High Quality Temporal Supersampling", SIGGRAPH 2014, <a href="https://advances.realtimerendering.com/s2014/" target="_blank" rel="noopener">https://advances.realtimerendering.com/s2014/</a></li>
- <li>Riley/Arcila, FidelityFX Super Resolution 2, GDC 2022, <a href="https://gpuopen.com/download/GDC_FidelityFX_Super_Resolution_2_0.pdf" target="_blank" rel="noopener">https://gpuopen.com/download/GDC_FidelityFX_Super_Resolution_2_0.pdf</a></li>
- </ul>
- <p>Note: MSAA must be disabled when TAAU is in use.</p></div>
- </header>
- <article>
- <h2 class="subsection-title">Import</h2>
- <p><span translate="no">TAAUNode</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 { taau } from 'three/addons/tsl/display/TAAUNode.js';</code></pre>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="TAAUNode" translate="no">new <a href="#TAAUNode">TAAUNode</a><span class="signature">( beautyNode : <span class="param-type"><a href="TextureNode.html">TextureNode</a></span>, depthNode : <span class="param-type"><a href="TextureNode.html">TextureNode</a></span>, velocityNode : <span class="param-type"><a href="TextureNode.html">TextureNode</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 TAAU node.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">beautyNode</strong>
- </td>
- <td class="description last">
- <p>The texture node that represents the input of the effect.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">depthNode</strong>
- </td>
- <td class="description last">
- <p>A node that represents the scene's depth.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">velocityNode</strong>
- </td>
- <td class="description last">
- <p>A node that represents the scene's velocity.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">camera</strong>
- </td>
- <td class="description last">
- <p>The camera the scene is rendered with.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <h2 class="subsection-title">Properties</h2>
- <div class="member">
- <h3 class="name" id="beautyNode" translate="no">.<a href="#beautyNode">beautyNode</a><span class="type-signature"> : <a href="TextureNode.html">TextureNode</a></span> </h3>
- <div class="description">
- <p>The texture node that represents the input of the effect.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="camera" translate="no">.<a href="#camera">camera</a><span class="type-signature"> : <a href="Camera.html">Camera</a></span> </h3>
- <div class="description">
- <p>The camera the scene is rendered with.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="currentFrameWeight" translate="no">.<a href="#currentFrameWeight">currentFrameWeight</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>Baseline weight applied to the current frame in the resolve. Lower
- values produce smoother results with longer accumulation but slower
- convergence on disoccluded regions; the motion factor is added on
- top, so fast-moving pixels still respond quickly.</p>
- <p>Default is <code>0.025</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="depthNode" translate="no">.<a href="#depthNode">depthNode</a><span class="type-signature"> : <a href="TextureNode.html">TextureNode</a></span> </h3>
- <div class="description">
- <p>A node that represents the scene's depth.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="depthThreshold" translate="no">.<a href="#depthThreshold">depthThreshold</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>When the difference between the current and previous depth goes above this threshold,
- the history is considered invalid.</p>
- <p>Default is <code>0.0005</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="edgeDepthDiff" translate="no">.<a href="#edgeDepthDiff">edgeDepthDiff</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The depth difference within the 3×3 neighborhood to consider a pixel as an edge.</p>
- <p>Default is <code>0.001</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="isTAAUNode" translate="no">.<a href="#isTAAUNode">isTAAUNode</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="maxVelocityLength" translate="no">.<a href="#maxVelocityLength">maxVelocityLength</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The history becomes invalid as the pixel length of the velocity approaches this value.</p>
- <p>Default is <code>128</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="updateBeforeType" translate="no">.<a href="#updateBeforeType">updateBeforeType</a><span class="type-signature"> : string</span> </h3>
- <div class="description">
- <p>The <code>updateBeforeType</code> is set to <code>NodeUpdateType.FRAME</code> since the node renders
- its effect once per frame in <code>updateBefore()</code>.</p>
- <p>Default is <code>'frame'</code>.</p>
- </div>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBeforeType">TempNode#updateBeforeType</a></dt>
- </dl>
- </div>
- <div class="member">
- <h3 class="name" id="velocityNode" translate="no">.<a href="#velocityNode">velocityNode</a><span class="type-signature"> : <a href="TextureNode.html">TextureNode</a></span> </h3>
- <div class="description">
- <p>A node that represents the scene's velocity.</p>
- </div>
- </div>
- <h2 class="subsection-title">Methods</h2>
- <h3 class="name name-method" id="clearViewOffset" translate="no">.<a href="#clearViewOffset">clearViewOffset</a><span class="signature">()</span> </h3>
- <div class="method">
- <div class="description">
- <p>Clears the view offset from the scene's camera.</p>
- </div>
- </div>
- <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 effect is no longer required.</p>
- </div>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#dispose">TempNode#dispose</a></dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getTextureNode" translate="no">.<a href="#getTextureNode">getTextureNode</a><span class="signature">()</span><span class="type-signature"> : <a href="PassTextureNode.html">PassTextureNode</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the result of the effect as a texture node.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A texture node that represents the result of the effect.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="setSize" translate="no">.<a href="#setSize">setSize</a><span class="signature">( outputWidth : <span class="param-type">number</span>, outputHeight : <span class="param-type">number</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets the output size of the effect (history and resolve targets). The
- previous-depth texture is sized independently in <code>updateBefore()</code> to
- track the scene's current depth texture.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">outputWidth</strong>
- </td>
- <td class="description last">
- <p>The output width (drawing buffer width).</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">outputHeight</strong>
- </td>
- <td class="description last">
- <p>The output height (drawing buffer height).</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="setViewOffset" translate="no">.<a href="#setViewOffset">setViewOffset</a><span class="signature">( inputWidth : <span class="param-type">number</span>, inputHeight : <span class="param-type">number</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Defines the TAAU's current jitter as a view offset to the scene's
- camera. The jitter is shrunk to one <em>output</em> pixel (rather than one
- input pixel) so that the halton sequence gradually fills the output
- sub-pixel grid over multiple frames.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">inputWidth</strong>
- </td>
- <td class="description last">
- <p>The width of the input buffers the camera renders into.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">inputHeight</strong>
- </td>
- <td class="description last">
- <p>The height of the input buffers the camera renders into.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </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 render targets and TSL code.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">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="TempNode.html#setup">TempNode#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 effect once per frame.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">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="TempNode.html#updateBefore">TempNode#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/TAAUNode.js" translate="no" target="_blank" rel="noopener">examples/jsm/tsl/display/TAAUNode.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|