WebGPURenderer.html 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>WebGPURenderer - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="Renderer.html">Renderer</a> → </p>
  13. <h1 translate="no">WebGPURenderer</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This renderer is the new alternative of <code>WebGLRenderer</code>. <code>WebGPURenderer</code> has the ability
  17. to target different backends. By default, the renderer tries to use a WebGPU backend if the
  18. browser supports WebGPU. If not, <code>WebGPURenderer</code> falls backs to a WebGL 2 backend.</p></div>
  19. </header>
  20. <article>
  21. <div class="container-overview">
  22. <h2>Constructor</h2>
  23. <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>
  24. <div class="method">
  25. <div class="description">
  26. <p>Constructs a new WebGPU renderer.</p>
  27. </div>
  28. <table class="params">
  29. <tbody>
  30. <tr>
  31. <td class="name"><code>parameters</code></td>
  32. <td class="description last"><p>The configuration parameter.</p></td>
  33. </tr>
  34. </tbody>
  35. </table>
  36. </div>
  37. </div>
  38. <h2 class="subsection-title">Properties</h2>
  39. <div class="member">
  40. <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>
  41. <div class="description">
  42. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  43. </div>
  44. </div>
  45. <div class="member">
  46. <h3 class="name" id="library" translate="no">.<a href="#library">library</a><span class="type-signature"> : <a href="StandardNodeLibrary.html">StandardNodeLibrary</a></span> </h3>
  47. <div class="description">
  48. <p>The generic default value is overwritten with the
  49. standard node library for type mapping.</p>
  50. </div>
  51. <dl class="details">
  52. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Renderer.html#library">Renderer#library</a></dt>
  53. </dl>
  54. </div>
  55. <h2 class="subsection-title">Type Definitions</h2>
  56. <div class="member">
  57. <h3 class="name" id="~Options" translate="no">.<a href="#~Options">Options</a> </h3>
  58. <div class="description">
  59. <p>WebGPURenderer options.</p>
  60. </div>
  61. <h5 class="subsection-title">Properties:</h5>
  62. <table class="props">
  63. <thead>
  64. <tr>
  65. <th>Name</th>
  66. <th>Type</th>
  67. <th>Attributes</th>
  68. <th>Default</th>
  69. <th class="last">Description</th>
  70. </tr>
  71. </thead>
  72. <tbody>
  73. <tr>
  74. <td class="name"><code>logarithmicDepthBuffer</code></td>
  75. <td class="type">
  76. <span class="param-type">boolean</span>
  77. </td>
  78. <td class="attributes">
  79. &lt;optional><br>
  80. </td>
  81. <td class="default">
  82. false
  83. </td>
  84. <td class="description last"><p>Whether logarithmic depth buffer is enabled or not.</p></td>
  85. </tr>
  86. <tr>
  87. <td class="name"><code>alpha</code></td>
  88. <td class="type">
  89. <span class="param-type">boolean</span>
  90. </td>
  91. <td class="attributes">
  92. &lt;optional><br>
  93. </td>
  94. <td class="default">
  95. true
  96. </td>
  97. <td class="description last"><p>Whether the default framebuffer (which represents the final contents of the canvas) should be transparent or opaque.</p></td>
  98. </tr>
  99. <tr>
  100. <td class="name"><code>depth</code></td>
  101. <td class="type">
  102. <span class="param-type">boolean</span>
  103. </td>
  104. <td class="attributes">
  105. &lt;optional><br>
  106. </td>
  107. <td class="default">
  108. true
  109. </td>
  110. <td class="description last"><p>Whether the default framebuffer should have a depth buffer or not.</p></td>
  111. </tr>
  112. <tr>
  113. <td class="name"><code>stencil</code></td>
  114. <td class="type">
  115. <span class="param-type">boolean</span>
  116. </td>
  117. <td class="attributes">
  118. &lt;optional><br>
  119. </td>
  120. <td class="default">
  121. false
  122. </td>
  123. <td class="description last"><p>Whether the default framebuffer should have a stencil buffer or not.</p></td>
  124. </tr>
  125. <tr>
  126. <td class="name"><code>antialias</code></td>
  127. <td class="type">
  128. <span class="param-type">boolean</span>
  129. </td>
  130. <td class="attributes">
  131. &lt;optional><br>
  132. </td>
  133. <td class="default">
  134. false
  135. </td>
  136. <td class="description last"><p>Whether MSAA as the default anti-aliasing should be enabled or not.</p></td>
  137. </tr>
  138. <tr>
  139. <td class="name"><code>samples</code></td>
  140. <td class="type">
  141. <span class="param-type">number</span>
  142. </td>
  143. <td class="attributes">
  144. &lt;optional><br>
  145. </td>
  146. <td class="default">
  147. 0
  148. </td>
  149. <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>
  150. </tr>
  151. <tr>
  152. <td class="name"><code>forceWebGL</code></td>
  153. <td class="type">
  154. <span class="param-type">boolean</span>
  155. </td>
  156. <td class="attributes">
  157. &lt;optional><br>
  158. </td>
  159. <td class="default">
  160. false
  161. </td>
  162. <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>
  163. </tr>
  164. <tr>
  165. <td class="name"><code>multiview</code></td>
  166. <td class="type">
  167. <span class="param-type">boolean</span>
  168. </td>
  169. <td class="attributes">
  170. &lt;optional><br>
  171. </td>
  172. <td class="default">
  173. false
  174. </td>
  175. <td class="description last"><p>If set to <code>true</code>, the renderer will use multiview during WebXR rendering if supported.</p></td>
  176. </tr>
  177. <tr>
  178. <td class="name"><code>outputType</code></td>
  179. <td class="type">
  180. <span class="param-type">number</span>
  181. </td>
  182. <td class="attributes">
  183. &lt;optional><br>
  184. </td>
  185. <td class="default">
  186. </td>
  187. <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>
  188. </tr>
  189. <tr>
  190. <td class="name"><code>colorBufferType</code></td>
  191. <td class="type">
  192. <span class="param-type">number</span>
  193. </td>
  194. <td class="attributes">
  195. &lt;optional><br>
  196. </td>
  197. <td class="default">
  198. HalfFloatType
  199. </td>
  200. <td class="description last"><p>Defines the type of color buffers. The default <code>HalfFloatType</code> is recommend for best
  201. quality. To save memory and bandwidth, <code>UnsignedByteType</code> might be used. This will reduce rendering quality though.</p></td>
  202. </tr>
  203. </tbody>
  204. </table>
  205. </div>
  206. <h2 class="subsection-title">Source</h2>
  207. <p>
  208. <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>
  209. </p>
  210. </article>
  211. </section>
  212. <script src="../scripts/linenumber.js"></script>
  213. <script src="../scripts/page.js"></script>
  214. </body>
  215. </html>
粤ICP备19079148号