1
0

StorageTexture.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>StorageTexture - 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="EventDispatcher.html">EventDispatcher</a> → <a href="Texture.html">Texture</a> → </p>
  13. <h1 translate="no">StorageTexture</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This special type of texture is intended for compute shaders.
  17. It can be used to compute the data of a texture with a compute shader.</p>
  18. <p>Note: This type of texture can only be used with <code>WebGPURenderer</code>
  19. and a WebGPU backend.</p></div>
  20. </header>
  21. <article>
  22. <div class="container-overview">
  23. <h2>Constructor</h2>
  24. <h3 class="name name-method" id="StorageTexture" translate="no">new <a href="#StorageTexture">StorageTexture</a><span class="signature">( width : <span class="param-type">number</span>, height : <span class="param-type">number</span> )</span> </h3>
  25. <div class="method">
  26. <div class="description">
  27. <p>Constructs a new storage texture.</p>
  28. </div>
  29. <table class="params">
  30. <tbody>
  31. <tr>
  32. <td class="name">
  33. <strong>width</strong>
  34. </td>
  35. <td class="description last">
  36. <p>The storage texture's width.</p>
  37. <p>Default is <code>1</code>.</p>
  38. </td>
  39. </tr>
  40. <tr>
  41. <td class="name">
  42. <strong>height</strong>
  43. </td>
  44. <td class="description last">
  45. <p>The storage texture's height.</p>
  46. <p>Default is <code>1</code>.</p>
  47. </td>
  48. </tr>
  49. </tbody>
  50. </table>
  51. </div>
  52. </div>
  53. <h2 class="subsection-title">Properties</h2>
  54. <div class="member">
  55. <h3 class="name" id="image" translate="no">.<a href="#image">image</a><span class="type-signature"> : Object</span> </h3>
  56. <div class="description">
  57. <p>The image object which just represents the texture's dimension.</p>
  58. </div>
  59. <dl class="details">
  60. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#image">Texture#image</a></dt>
  61. </dl>
  62. </div>
  63. <div class="member">
  64. <h3 class="name" id="isStorageTexture" translate="no">.<a href="#isStorageTexture">isStorageTexture</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  65. <div class="description">
  66. <p>This flag can be used for type testing.</p>
  67. <p>Default is <code>true</code>.</p>
  68. </div>
  69. </div>
  70. <div class="member">
  71. <h3 class="name" id="magFilter" translate="no">.<a href="#magFilter">magFilter</a><span class="type-signature"> : number</span> </h3>
  72. <div class="description">
  73. <p>The default <code>magFilter</code> for storage textures is <code>THREE.LinearFilter</code>.</p>
  74. </div>
  75. <dl class="details">
  76. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#magFilter">Texture#magFilter</a></dt>
  77. </dl>
  78. </div>
  79. <div class="member">
  80. <h3 class="name" id="minFilter" translate="no">.<a href="#minFilter">minFilter</a><span class="type-signature"> : number</span> </h3>
  81. <div class="description">
  82. <p>The default <code>minFilter</code> for storage textures is <code>THREE.LinearFilter</code>.</p>
  83. </div>
  84. <dl class="details">
  85. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#minFilter">Texture#minFilter</a></dt>
  86. </dl>
  87. </div>
  88. <div class="member">
  89. <h3 class="name" id="mipmapsAutoUpdate" translate="no">.<a href="#mipmapsAutoUpdate">mipmapsAutoUpdate</a><span class="type-signature"> : boolean</span> </h3>
  90. <div class="description">
  91. <p>When <code>true</code>, mipmaps will be auto-generated after compute writes.
  92. When <code>false</code>, mipmaps must be written manually via compute shaders.</p>
  93. <p>Default is <code>true</code>.</p>
  94. </div>
  95. </div>
  96. <h2 class="subsection-title">Methods</h2>
  97. <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>
  98. <div class="method">
  99. <div class="description">
  100. <p>Sets the size of the storage texture.</p>
  101. </div>
  102. <table class="params">
  103. <tbody>
  104. <tr>
  105. <td class="name">
  106. <strong>width</strong>
  107. </td>
  108. <td class="description last">
  109. <p>The new width of the storage texture.</p>
  110. </td>
  111. </tr>
  112. <tr>
  113. <td class="name">
  114. <strong>height</strong>
  115. </td>
  116. <td class="description last">
  117. <p>The new height of the storage texture.</p>
  118. </td>
  119. </tr>
  120. </tbody>
  121. </table>
  122. </div>
  123. <h2 class="subsection-title">Source</h2>
  124. <p>
  125. <a href="https://github.com/mrdoob/three.js/blob/master/src/renderers/common/StorageTexture.js" translate="no" target="_blank" rel="noopener">src/renderers/common/StorageTexture.js</a>
  126. </p>
  127. </article>
  128. </section>
  129. <script src="../scripts/linenumber.js"></script>
  130. <script src="../scripts/page.js"></script>
  131. </body>
  132. </html>
粤ICP备19079148号