| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>WebGPURenderer - 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="Renderer.html">Renderer</a> → </p>
- <h1 translate="no">WebGPURenderer</h1>
- <section>
- <header>
- <div class="class-description"><p>This renderer is the new alternative of <code>WebGLRenderer</code>. <code>WebGPURenderer</code> has the ability
- to target different backends. By default, the renderer tries to use a WebGPU backend if the
- browser supports WebGPU. If not, <code>WebGPURenderer</code> falls backs to a WebGL 2 backend.</p></div>
- </header>
- <article>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="WebGPURenderer" translate="no">new <a href="#WebGPURenderer">WebGPURenderer</a><span class="signature">( parameters : <span class="param-type">WebGPURenderer~Options</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Constructs a new WebGPU renderer.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name"><code>parameters</code></td>
- <td class="description last"><p>The configuration parameter.</p></td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <h2 class="subsection-title">Properties</h2>
- <div class="member">
- <h3 class="name" id="isWebGPURenderer" translate="no">.<a href="#isWebGPURenderer">isWebGPURenderer</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.<br/>Default is <code>true</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="library" translate="no">.<a href="#library">library</a><span class="type-signature"> : <a href="StandardNodeLibrary.html">StandardNodeLibrary</a></span> </h3>
- <div class="description">
- <p>The generic default value is overwritten with the
- standard node library for type mapping.</p>
- </div>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Renderer.html#library">Renderer#library</a></dt>
- </dl>
- </div>
- <h2 class="subsection-title">Type Definitions</h2>
- <div class="member">
- <h3 class="name" id="~Options" translate="no">.<a href="#~Options">Options</a> </h3>
- <div class="description">
- <p>WebGPURenderer options.</p>
- </div>
- <h5 class="subsection-title">Properties:</h5>
- <table class="props">
- <thead>
- <tr>
- <th>Name</th>
- <th>Type</th>
- <th>Attributes</th>
- <th>Default</th>
- <th class="last">Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td class="name"><code>logarithmicDepthBuffer</code></td>
- <td class="type">
- <span class="param-type">boolean</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- false
- </td>
- <td class="description last"><p>Whether logarithmic depth buffer is enabled or not.</p></td>
- </tr>
- <tr>
- <td class="name"><code>alpha</code></td>
- <td class="type">
- <span class="param-type">boolean</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- true
- </td>
- <td class="description last"><p>Whether the default framebuffer (which represents the final contents of the canvas) should be transparent or opaque.</p></td>
- </tr>
- <tr>
- <td class="name"><code>depth</code></td>
- <td class="type">
- <span class="param-type">boolean</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- true
- </td>
- <td class="description last"><p>Whether the default framebuffer should have a depth buffer or not.</p></td>
- </tr>
- <tr>
- <td class="name"><code>stencil</code></td>
- <td class="type">
- <span class="param-type">boolean</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- false
- </td>
- <td class="description last"><p>Whether the default framebuffer should have a stencil buffer or not.</p></td>
- </tr>
- <tr>
- <td class="name"><code>antialias</code></td>
- <td class="type">
- <span class="param-type">boolean</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- false
- </td>
- <td class="description last"><p>Whether MSAA as the default anti-aliasing should be enabled or not.</p></td>
- </tr>
- <tr>
- <td class="name"><code>samples</code></td>
- <td class="type">
- <span class="param-type">number</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- 0
- </td>
- <td class="description last"><p>When <code>antialias</code> is <code>true</code>, <code>4</code> samples are used by default. Set this parameter to any other integer value than 0 to overwrite the default.</p></td>
- </tr>
- <tr>
- <td class="name"><code>forceWebGL</code></td>
- <td class="type">
- <span class="param-type">boolean</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- false
- </td>
- <td class="description last"><p>If set to <code>true</code>, the renderer uses a WebGL 2 backend no matter if WebGPU is supported or not.</p></td>
- </tr>
- <tr>
- <td class="name"><code>multiview</code></td>
- <td class="type">
- <span class="param-type">boolean</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- false
- </td>
- <td class="description last"><p>If set to <code>true</code>, the renderer will use multiview during WebXR rendering if supported.</p></td>
- </tr>
- <tr>
- <td class="name"><code>outputType</code></td>
- <td class="type">
- <span class="param-type">number</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- </td>
- <td class="description last"><p>Texture type for output to canvas. By default, device's preferred format is used; other formats may incur overhead.</p></td>
- </tr>
- <tr>
- <td class="name"><code>colorBufferType</code></td>
- <td class="type">
- <span class="param-type">number</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- HalfFloatType
- </td>
- <td class="description last"><p>Defines the type of color buffers. The default <code>HalfFloatType</code> is recommend for best
- quality. To save memory and bandwidth, <code>UnsignedByteType</code> might be used. This will reduce rendering quality though.</p></td>
- </tr>
- </tbody>
- </table>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/src/renderers/webgpu/WebGPURenderer.js" target="_blank" rel="noopener" translate="no">src/renderers/webgpu/WebGPURenderer.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|