| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>ImportanceSampledEnvironment - 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>
- <h1 translate="no">ImportanceSampledEnvironment</h1>
- <section>
- <header>
- <div class="class-description"><p>Manages a preprocessed HDR environment map (CDF textures, uniforms) and exposes
- TSL helpers for BRDF-direction lookups and MIS importance sampling.</p></div>
- </header>
- <article>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="ImportanceSampledEnvironment" translate="no">new <a href="#ImportanceSampledEnvironment">ImportanceSampledEnvironment</a><span class="signature">( importanceSampling : <span class="param-type">boolean</span> )</span> </h3>
- <div class="method">
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">importanceSampling</strong>
- </td>
- <td class="description last">
- <p>When <code>true</code>, builds luminance CDF tables and enables MIS env sampling.</p>
- <p>Default is <code>false</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-see">See:</dt>
- <dd class="tag-see">
- <ul>
- <li><a href="https://github.com/gkjohnson/three-gpu-pathtracer" target="_blank" rel="noopener">https://github.com/gkjohnson/three-gpu-pathtracer</a></li>
- </ul>
- </dd>
- </dl>
- </div>
- </div>
- <h2 class="subsection-title">Methods</h2>
- <h3 class="name name-method" id="sampleEnvironmentBRDF" translate="no">.<a href="#sampleEnvironmentBRDF">sampleEnvironmentBRDF</a><span class="signature">( params : <span class="param-type">Object</span> )</span><span class="type-signature"> : <a href="Node.html">Node</a>.<vec3></span> </h3>
- <div class="method">
- <div class="description">
- <p>Environment reflection for a screen-space miss using only the BRDF / reflected-ray direction.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">params</strong>
- </td>
- <td class="description last">
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">cameraWorldMatrix</strong>
- </td>
- <td class="description last">
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">viewReflectDir</strong>
- </td>
- <td class="description last">
- <p>View-space GGX-sampled reflected ray.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">N</strong>
- </td>
- <td class="description last">
- <p>View-space shading normal.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">V</strong>
- </td>
- <td class="description last">
- <p>View-space direction to camera.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">alpha</strong>
- </td>
- <td class="description last">
- <p>GGX roughness (alpha).</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">f0</strong>
- </td>
- <td class="description last">
- </td>
- </tr>
- </tbody>
- </table>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="sampleEnvironmentMIS" translate="no">.<a href="#sampleEnvironmentMIS">sampleEnvironmentMIS</a><span class="signature">( params : <span class="param-type">Object</span> )</span><span class="type-signature"> : <a href="Node.html">Node</a>.<vec3></span> </h3>
- <div class="method">
- <div class="description">
- <p>Environment reflection for a screen-space miss, estimated with multiple importance
- sampling (MIS) between the BRDF / reflected-ray direction and the env-luminance CDF
- direction. Both techniques use consistent solid-angle PDFs (<code>D·G1(N·V)/(4·N·V)</code>), so
- the power heuristic is unbiased. Adapted from three-gpu-pathtracer.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">params</strong>
- </td>
- <td class="description last">
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">cameraWorldMatrix</strong>
- </td>
- <td class="description last">
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">viewReflectDir</strong>
- </td>
- <td class="description last">
- <p>View-space GGX-sampled reflected ray.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">N</strong>
- </td>
- <td class="description last">
- <p>View-space shading normal.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">V</strong>
- </td>
- <td class="description last">
- <p>View-space direction to camera.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">alpha</strong>
- </td>
- <td class="description last">
- <p>GGX roughness (alpha).</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">f0</strong>
- </td>
- <td class="description last">
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">Xi2</strong>
- </td>
- <td class="description last">
- <p>Second blue-noise sample (zw used for the CDF).</p>
- </td>
- </tr>
- </tbody>
- </table>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-see">See:</dt>
- <dd class="tag-see">
- <ul>
- <li><a href="https://github.com/gkjohnson/three-gpu-pathtracer" target="_blank" rel="noopener">https://github.com/gkjohnson/three-gpu-pathtracer</a></li>
- </ul>
- </dd>
- </dl>
- </div>
- <h3 class="name name-method" id="sampleReflect" translate="no">.<a href="#sampleReflect">sampleReflect</a><span class="signature">( params : <span class="param-type">Object</span> )</span><span class="type-signature"> : <a href="Node.html">Node</a>.<vec3></span> </h3>
- <div class="method">
- <div class="description">
- <p>Simple environment lookup along the reflected direction (no MIS).</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">params</strong>
- </td>
- <td class="description last">
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">cameraWorldMatrix</strong>
- </td>
- <td class="description last">
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">viewReflectDir</strong>
- </td>
- <td class="description last">
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">sampleWeight</strong>
- </td>
- <td class="description last">
- <p>Optional radiance scale (defaults to 1).</p>
- </td>
- </tr>
- </tbody>
- </table>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="updateFrom" translate="no">.<a href="#updateFrom">updateFrom</a><span class="signature">( hdr : <span class="param-type"><a href="Texture.html">Texture</a></span> )</span> </h3>
- <div class="method">
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">hdr</strong>
- </td>
- <td class="description last">
- <p>Equirectangular HDR environment map.</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/tsl/display/ImportanceSampledEnvironment.js" translate="no" target="_blank" rel="noopener">examples/jsm/tsl/display/ImportanceSampledEnvironment.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|