StorageBufferAttribute.html 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>StorageBufferAttribute - 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="BufferAttribute.html">BufferAttribute</a> → </p>
  13. <h1 translate="no">StorageBufferAttribute</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This special type of buffer attribute is intended for compute shaders.
  17. In earlier three.js versions it was only possible to update attribute data
  18. on the CPU via JavaScript and then upload the data to the GPU. With the
  19. new material system and renderer it is now possible to use compute shaders
  20. to compute the data for an attribute more efficiently on the GPU.</p>
  21. <p>The idea is to create an instance of this class and provide it as an input
  22. to <a href="StorageBufferNode.html">StorageBufferNode</a>.</p>
  23. <p>Note: This type of buffer attribute can only be used with <code>WebGPURenderer</code>.</p></div>
  24. </header>
  25. <article>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="StorageBufferAttribute" translate="no">new <a href="#StorageBufferAttribute">StorageBufferAttribute</a><span class="signature">( count : <span class="param-type">number | TypedArray</span>, itemSize : <span class="param-type">number</span>, typeClass : <span class="param-type">TypedArray.constructor</span> )</span> </h3>
  29. <div class="method">
  30. <div class="description">
  31. <p>Constructs a new storage buffer attribute.</p>
  32. </div>
  33. <table class="params">
  34. <tbody>
  35. <tr>
  36. <td class="name">
  37. <strong>count</strong>
  38. </td>
  39. <td class="description last">
  40. <p>The item count. It is also valid to pass a typed array as an argument.
  41. The subsequent parameters are then obsolete.</p>
  42. </td>
  43. </tr>
  44. <tr>
  45. <td class="name">
  46. <strong>itemSize</strong>
  47. </td>
  48. <td class="description last">
  49. <p>The item size.</p>
  50. </td>
  51. </tr>
  52. <tr>
  53. <td class="name">
  54. <strong>typeClass</strong>
  55. </td>
  56. <td class="description last">
  57. <p>A typed array constructor.</p>
  58. <p>Default is <code>Float32Array</code>.</p>
  59. </td>
  60. </tr>
  61. </tbody>
  62. </table>
  63. </div>
  64. </div>
  65. <h2 class="subsection-title">Properties</h2>
  66. <div class="member">
  67. <h3 class="name" id="isStorageBufferAttribute" translate="no">.<a href="#isStorageBufferAttribute">isStorageBufferAttribute</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  68. <div class="description">
  69. <p>This flag can be used for type testing.</p>
  70. <p>Default is <code>true</code>.</p>
  71. </div>
  72. </div>
  73. <h2 class="subsection-title">Source</h2>
  74. <p>
  75. <a href="https://github.com/mrdoob/three.js/blob/master/src/renderers/common/StorageBufferAttribute.js" translate="no" target="_blank" rel="noopener">src/renderers/common/StorageBufferAttribute.js</a>
  76. </p>
  77. </article>
  78. </section>
  79. <script src="../scripts/linenumber.js"></script>
  80. <script src="../scripts/page.js"></script>
  81. </body>
  82. </html>
粤ICP备19079148号