StorageTexture.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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"><code>width</code></td>
  33. <td class="description last"><p>The storage texture's width.<br/>Default is <code>1</code>.</p></td>
  34. </tr>
  35. <tr>
  36. <td class="name"><code>height</code></td>
  37. <td class="description last"><p>The storage texture's height.<br/>Default is <code>1</code>.</p></td>
  38. </tr>
  39. </tbody>
  40. </table>
  41. </div>
  42. </div>
  43. <h2 class="subsection-title">Properties</h2>
  44. <div class="member">
  45. <h3 class="name" id="image" translate="no">.<a href="#image">image</a><span class="type-signature"> : Object</span> </h3>
  46. <div class="description">
  47. <p>The image object which just represents the texture's dimension.</p>
  48. </div>
  49. <dl class="details">
  50. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#image">Texture#image</a></dt>
  51. </dl>
  52. </div>
  53. <div class="member">
  54. <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>
  55. <div class="description">
  56. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  57. </div>
  58. </div>
  59. <div class="member">
  60. <h3 class="name" id="magFilter" translate="no">.<a href="#magFilter">magFilter</a><span class="type-signature"> : number</span> </h3>
  61. <div class="description">
  62. <p>The default <code>magFilter</code> for storage textures is <code>THREE.LinearFilter</code>.</p>
  63. </div>
  64. <dl class="details">
  65. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#magFilter">Texture#magFilter</a></dt>
  66. </dl>
  67. </div>
  68. <div class="member">
  69. <h3 class="name" id="minFilter" translate="no">.<a href="#minFilter">minFilter</a><span class="type-signature"> : number</span> </h3>
  70. <div class="description">
  71. <p>The default <code>minFilter</code> for storage textures is <code>THREE.LinearFilter</code>.</p>
  72. </div>
  73. <dl class="details">
  74. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#minFilter">Texture#minFilter</a></dt>
  75. </dl>
  76. </div>
  77. <div class="member">
  78. <h3 class="name" id="mipmapsAutoUpdate" translate="no">.<a href="#mipmapsAutoUpdate">mipmapsAutoUpdate</a><span class="type-signature"> : boolean</span> </h3>
  79. <div class="description">
  80. <p>When <code>true</code>, mipmaps will be auto-generated after compute writes.
  81. When <code>false</code>, mipmaps must be written manually via compute shaders.<br/>Default is <code>true</code>.</p>
  82. </div>
  83. </div>
  84. <h2 class="subsection-title">Methods</h2>
  85. <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>
  86. <div class="method">
  87. <div class="description">
  88. <p>Sets the size of the storage texture.</p>
  89. </div>
  90. <table class="params">
  91. <tbody>
  92. <tr>
  93. <td class="name"><code>width</code></td>
  94. <td class="description last"><p>The new width of the storage texture.</p></td>
  95. </tr>
  96. <tr>
  97. <td class="name"><code>height</code></td>
  98. <td class="description last"><p>The new height of the storage texture.</p></td>
  99. </tr>
  100. </tbody>
  101. </table>
  102. </div>
  103. <h2 class="subsection-title">Source</h2>
  104. <p>
  105. <a href="https://github.com/mrdoob/three.js/blob/master/src/renderers/common/StorageTexture.js" target="_blank" rel="noopener" translate="no">src/renderers/common/StorageTexture.js</a>
  106. </p>
  107. </article>
  108. </section>
  109. <script src="../scripts/linenumber.js"></script>
  110. <script src="../scripts/page.js"></script>
  111. </body>
  112. </html>
粤ICP备19079148号