DataArrayTexture.html 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>DataArrayTexture - 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">DataArrayTexture</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Creates an array of textures directly from raw buffer data.</p></div>
  17. </header>
  18. <article>
  19. <div class="container-overview">
  20. <h2>Constructor</h2>
  21. <h3 class="name name-method" id="DataArrayTexture" translate="no">new <a href="#DataArrayTexture">DataArrayTexture</a><span class="signature">( data : <span class="param-type">TypedArray</span>, width : <span class="param-type">number</span>, height : <span class="param-type">number</span>, depth : <span class="param-type">number</span> )</span> </h3>
  22. <div class="method">
  23. <div class="description">
  24. <p>Constructs a new data array texture.</p>
  25. </div>
  26. <table class="params">
  27. <tbody>
  28. <tr>
  29. <td class="name">
  30. <strong>data</strong>
  31. </td>
  32. <td class="description last">
  33. <p>The buffer data.</p>
  34. <p>Default is <code>null</code>.</p>
  35. </td>
  36. </tr>
  37. <tr>
  38. <td class="name">
  39. <strong>width</strong>
  40. </td>
  41. <td class="description last">
  42. <p>The width of the texture.</p>
  43. <p>Default is <code>1</code>.</p>
  44. </td>
  45. </tr>
  46. <tr>
  47. <td class="name">
  48. <strong>height</strong>
  49. </td>
  50. <td class="description last">
  51. <p>The height of the texture.</p>
  52. <p>Default is <code>1</code>.</p>
  53. </td>
  54. </tr>
  55. <tr>
  56. <td class="name">
  57. <strong>depth</strong>
  58. </td>
  59. <td class="description last">
  60. <p>The depth of the texture.</p>
  61. <p>Default is <code>1</code>.</p>
  62. </td>
  63. </tr>
  64. </tbody>
  65. </table>
  66. </div>
  67. </div>
  68. <h2 class="subsection-title">Properties</h2>
  69. <div class="member">
  70. <h3 class="name" id="flipY" translate="no">.<a href="#flipY">flipY</a><span class="type-signature"> : boolean</span> </h3>
  71. <div class="description">
  72. <p>If set to <code>true</code>, the texture is flipped along the vertical axis when
  73. uploaded to the GPU.</p>
  74. <p>Overwritten and set to <code>false</code> by default.</p>
  75. <p>Default is <code>false</code>.</p>
  76. </div>
  77. <dl class="details">
  78. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#flipY">Texture#flipY</a></dt>
  79. </dl>
  80. </div>
  81. <div class="member">
  82. <h3 class="name" id="generateMipmaps" translate="no">.<a href="#generateMipmaps">generateMipmaps</a><span class="type-signature"> : boolean</span> </h3>
  83. <div class="description">
  84. <p>Whether to generate mipmaps (if possible) for a texture.</p>
  85. <p>Overwritten and set to <code>false</code> by default.</p>
  86. <p>Default is <code>false</code>.</p>
  87. </div>
  88. <dl class="details">
  89. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#generateMipmaps">Texture#generateMipmaps</a></dt>
  90. </dl>
  91. </div>
  92. <div class="member">
  93. <h3 class="name" id="image" translate="no">.<a href="#image">image</a><span class="type-signature"> : Object</span> </h3>
  94. <div class="description">
  95. <p>The image definition of a data texture.</p>
  96. </div>
  97. <dl class="details">
  98. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#image">Texture#image</a></dt>
  99. </dl>
  100. </div>
  101. <div class="member">
  102. <h3 class="name" id="isDataArrayTexture" translate="no">.<a href="#isDataArrayTexture">isDataArrayTexture</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  103. <div class="description">
  104. <p>This flag can be used for type testing.</p>
  105. <p>Default is <code>true</code>.</p>
  106. </div>
  107. </div>
  108. <div class="member">
  109. <h3 class="name" id="layerUpdates" translate="no">.<a href="#layerUpdates">layerUpdates</a><span class="type-signature"> : Set.&lt;number></span> </h3>
  110. <div class="description">
  111. <p>A set of all layers which need to be updated in the texture.</p>
  112. </div>
  113. </div>
  114. <div class="member">
  115. <h3 class="name" id="magFilter" translate="no">.<a href="#magFilter">magFilter</a><span class="type-signature"> : <a href="global.html#NearestFilter">NearestFilter</a> | <a href="global.html#NearestMipmapNearestFilter">NearestMipmapNearestFilter</a> | <a href="global.html#NearestMipmapLinearFilter">NearestMipmapLinearFilter</a> | <a href="global.html#LinearFilter">LinearFilter</a> | <a href="global.html#LinearMipmapNearestFilter">LinearMipmapNearestFilter</a> | <a href="global.html#LinearMipmapLinearFilter">LinearMipmapLinearFilter</a></span> </h3>
  116. <div class="description">
  117. <p>How the texture is sampled when a texel covers more than one pixel.</p>
  118. <p>Overwritten and set to <code>NearestFilter</code> by default.</p>
  119. <p>Default is <code>NearestFilter</code>.</p>
  120. </div>
  121. <dl class="details">
  122. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#magFilter">Texture#magFilter</a></dt>
  123. </dl>
  124. </div>
  125. <div class="member">
  126. <h3 class="name" id="minFilter" translate="no">.<a href="#minFilter">minFilter</a><span class="type-signature"> : <a href="global.html#NearestFilter">NearestFilter</a> | <a href="global.html#NearestMipmapNearestFilter">NearestMipmapNearestFilter</a> | <a href="global.html#NearestMipmapLinearFilter">NearestMipmapLinearFilter</a> | <a href="global.html#LinearFilter">LinearFilter</a> | <a href="global.html#LinearMipmapNearestFilter">LinearMipmapNearestFilter</a> | <a href="global.html#LinearMipmapLinearFilter">LinearMipmapLinearFilter</a></span> </h3>
  127. <div class="description">
  128. <p>How the texture is sampled when a texel covers less than one pixel.</p>
  129. <p>Overwritten and set to <code>NearestFilter</code> by default.</p>
  130. <p>Default is <code>NearestFilter</code>.</p>
  131. </div>
  132. <dl class="details">
  133. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#minFilter">Texture#minFilter</a></dt>
  134. </dl>
  135. </div>
  136. <div class="member">
  137. <h3 class="name" id="unpackAlignment" translate="no">.<a href="#unpackAlignment">unpackAlignment</a><span class="type-signature"> : boolean</span> </h3>
  138. <div class="description">
  139. <p>Specifies the alignment requirements for the start of each pixel row in memory.</p>
  140. <p>Overwritten and set to <code>1</code> by default.</p>
  141. <p>Default is <code>1</code>.</p>
  142. </div>
  143. <dl class="details">
  144. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#unpackAlignment">Texture#unpackAlignment</a></dt>
  145. </dl>
  146. </div>
  147. <div class="member">
  148. <h3 class="name" id="wrapR" translate="no">.<a href="#wrapR">wrapR</a><span class="type-signature"> : <a href="global.html#RepeatWrapping">RepeatWrapping</a> | <a href="global.html#ClampToEdgeWrapping">ClampToEdgeWrapping</a> | <a href="global.html#MirroredRepeatWrapping">MirroredRepeatWrapping</a></span> </h3>
  149. <div class="description">
  150. <p>This defines how the texture is wrapped in the depth and corresponds to
  151. <em>W</em> in UVW mapping.</p>
  152. <p>Default is <code>ClampToEdgeWrapping</code>.</p>
  153. </div>
  154. </div>
  155. <h2 class="subsection-title">Methods</h2>
  156. <h3 class="name name-method" id="addLayerUpdate" translate="no">.<a href="#addLayerUpdate">addLayerUpdate</a><span class="signature">( layerIndex : <span class="param-type">number</span> )</span> </h3>
  157. <div class="method">
  158. <div class="description">
  159. <p>Describes that a specific layer of the texture needs to be updated.
  160. Normally when <a href="Texture.html#needsUpdate">Texture#needsUpdate</a> is set to <code>true</code>, the
  161. entire data texture array is sent to the GPU. Marking specific
  162. layers will only transmit subsets of all mipmaps associated with a
  163. specific depth in the array which is often much more performant.</p>
  164. </div>
  165. <table class="params">
  166. <tbody>
  167. <tr>
  168. <td class="name">
  169. <strong>layerIndex</strong>
  170. </td>
  171. <td class="description last">
  172. <p>The layer index that should be updated.</p>
  173. </td>
  174. </tr>
  175. </tbody>
  176. </table>
  177. </div>
  178. <h3 class="name name-method" id="clearLayerUpdates" translate="no">.<a href="#clearLayerUpdates">clearLayerUpdates</a><span class="signature">()</span> </h3>
  179. <div class="method">
  180. <div class="description">
  181. <p>Resets the layer updates registry.</p>
  182. </div>
  183. </div>
  184. <h2 class="subsection-title">Source</h2>
  185. <p>
  186. <a href="https://github.com/mrdoob/three.js/blob/master/src/textures/DataArrayTexture.js" translate="no" target="_blank" rel="noopener">src/textures/DataArrayTexture.js</a>
  187. </p>
  188. </article>
  189. </section>
  190. <script src="../scripts/linenumber.js"></script>
  191. <script src="../scripts/page.js"></script>
  192. </body>
  193. </html>
粤ICP备19079148号