| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>GTAOPass - 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="Pass.html">Pass</a> → </p>
- <h1 translate="no">GTAOPass</h1>
- <section>
- <header>
- <div class="class-description"><p>A pass for an GTAO effect.</p>
- <p><code>GTAOPass</code> provides better quality than <a href="SSAOPass.html">SSAOPass</a> but is also more expensive.</p></div>
- <h2>Code Example</h2>
- <div translate="no"><pre><code class="language-js">const gtaoPass = new GTAOPass( scene, camera, width, height );
- gtaoPass.output = GTAOPass.OUTPUT.Denoise;
- composer.addPass( gtaoPass );
- </code></pre></div>
- </header>
- <article>
- <h2 class="subsection-title">Import</h2>
- <p><span translate="no">GTAOPass</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 { GTAOPass } from 'three/addons/postprocessing/GTAOPass.js';</code></pre>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="GTAOPass" translate="no">new <a href="#GTAOPass">GTAOPass</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>, width : <span class="param-type">number</span>, height : <span class="param-type">number</span>, parameters : <span class="param-type">Object</span>, aoParameters : <span class="param-type">Object</span>, pdParameters : <span class="param-type">Object</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Constructs a new GTAO pass.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>scene</strong>
- </td>
- <td class="description last">
- <p>The scene to compute the AO for.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>camera</strong>
- </td>
- <td class="description last">
- <p>The camera.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>width</strong>
- </td>
- <td class="description last">
- <p>The width of the effect.</p>
- <p>Default is <code>512</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>height</strong>
- </td>
- <td class="description last">
- <p>The height of the effect.</p>
- <p>Default is <code>512</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>parameters</strong>
- </td>
- <td class="description last">
- <p>The pass parameters.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>aoParameters</strong>
- </td>
- <td class="description last">
- <p>The AO parameters.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>pdParameters</strong>
- </td>
- <td class="description last">
- <p>The denoise parameters.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <h2 class="subsection-title">Properties</h2>
- <div class="member">
- <h3 class="name" id="blendIntensity" translate="no">.<a href="#blendIntensity">blendIntensity</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The AO blend intensity.</p>
- <p>Default is <code>1</code>.</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.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="clear" translate="no">.<a href="#clear">clear</a><span class="type-signature"> : boolean</span> </h3>
- <div class="description">
- <p>Overwritten to perform a clear operation by default.</p>
- <p>Default is <code>true</code>.</p>
- </div>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#clear">Pass#clear</a></dt>
- </dl>
- </div>
- <div class="member">
- <h3 class="name" id="gtaoMap" translate="no">.<a href="#gtaoMap">gtaoMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> <span class="type-signature">(readonly) </span></h3>
- <div class="description">
- <p>A texture holding the computed AO.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="height" translate="no">.<a href="#height">height</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The height of the effect.</p>
- <p>Default is <code>512</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="output" translate="no">.<a href="#output">output</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The output configuration.</p>
- <p>Default is <code>0</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="pdRadiusExponent" translate="no">.<a href="#pdRadiusExponent">pdRadiusExponent</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The Poisson Denoise radius exponent.</p>
- <p>Default is <code>2</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="pdRings" translate="no">.<a href="#pdRings">pdRings</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The number of Poisson Denoise rings.</p>
- <p>Default is <code>2</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="pdSamples" translate="no">.<a href="#pdSamples">pdSamples</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The Poisson Denoise sample count.</p>
- <p>Default is <code>16</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="scene" translate="no">.<a href="#scene">scene</a><span class="type-signature"> : <a href="Scene.html">Scene</a></span> </h3>
- <div class="description">
- <p>The scene to render the AO for.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="width" translate="no">.<a href="#width">width</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The width of the effect.</p>
- <p>Default is <code>512</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 the GPU-related resources allocated by this instance. Call this
- method whenever the pass is no longer used in your app.</p>
- </div>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#dispose">Pass#dispose</a></dt>
- </dl>
- </div>
- <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>
- <div class="method">
- <div class="description">
- <p>Performs the GTAO pass.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>renderer</strong>
- </td>
- <td class="description last">
- <p>The renderer.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>writeBuffer</strong>
- </td>
- <td class="description last">
- <p>The write buffer. This buffer is intended as the rendering
- destination for the pass.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>readBuffer</strong>
- </td>
- <td class="description last">
- <p>The read buffer. The pass can access the result from the
- previous pass from this buffer.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>deltaTime</strong>
- </td>
- <td class="description last">
- <p>The delta time in seconds.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>maskActive</strong>
- </td>
- <td class="description last">
- <p>Whether masking is active or not.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#render">Pass#render</a></dt>
- </dl>
- </div>
- <h3 class="name name-method" id="setGBuffer" translate="no">.<a href="#setGBuffer">setGBuffer</a><span class="signature">( depthTexture : <span class="param-type"><a href="DepthTexture.html">DepthTexture</a></span>, normalTexture : <span class="param-type"><a href="DepthTexture.html">DepthTexture</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Configures the GBuffer of this pass. If no arguments are passed,
- the pass creates an internal render target for holding depth
- and normal data.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>depthTexture</strong>
- </td>
- <td class="description last">
- <p>The depth texture.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>normalTexture</strong>
- </td>
- <td class="description last">
- <p>The normal texture.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="setSceneClipBox" translate="no">.<a href="#setSceneClipBox">setSceneClipBox</a><span class="signature">( box : <span class="param-type"><a href="Box3.html">Box3</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Configures the clip box of the GTAO shader with the given AABB.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>box</strong>
- </td>
- <td class="description last">
- <p>The AABB enclosing the scene that should receive AO. When passing
- <code>null</code>, to clip box is used.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <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>
- <div class="method">
- <div class="description">
- <p>Sets the size of the pass.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>width</strong>
- </td>
- <td class="description last">
- <p>The width to set.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>height</strong>
- </td>
- <td class="description last">
- <p>The height to set.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#setSize">Pass#setSize</a></dt>
- </dl>
- </div>
- <h3 class="name name-method" id="updateGtaoMaterial" translate="no">.<a href="#updateGtaoMaterial">updateGtaoMaterial</a><span class="signature">( parameters : <span class="param-type">Object</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Updates the GTAO material from the given parameter object.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>parameters</strong>
- </td>
- <td class="description last">
- <p>The GTAO material parameters.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="updatePdMaterial" translate="no">.<a href="#updatePdMaterial">updatePdMaterial</a><span class="signature">( parameters : <span class="param-type">Object</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Updates the Denoise material from the given parameter object.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>parameters</strong>
- </td>
- <td class="description last">
- <p>The denoise parameters.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/postprocessing/GTAOPass.js" translate="no" target="_blank" rel="noopener">examples/jsm/postprocessing/GTAOPass.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|