DataArrayTexture.html 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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"><code>data</code></td>
  30. <td class="description last"><p>The buffer data.<br/>Default is <code>null</code>.</p></td>
  31. </tr>
  32. <tr>
  33. <td class="name"><code>width</code></td>
  34. <td class="description last"><p>The width of the texture.<br/>Default is <code>1</code>.</p></td>
  35. </tr>
  36. <tr>
  37. <td class="name"><code>height</code></td>
  38. <td class="description last"><p>The height of the texture.<br/>Default is <code>1</code>.</p></td>
  39. </tr>
  40. <tr>
  41. <td class="name"><code>depth</code></td>
  42. <td class="description last"><p>The depth of the texture.<br/>Default is <code>1</code>.</p></td>
  43. </tr>
  44. </tbody>
  45. </table>
  46. </div>
  47. </div>
  48. <h2 class="subsection-title">Properties</h2>
  49. <div class="member">
  50. <h3 class="name" id="flipY" translate="no">.<a href="#flipY">flipY</a><span class="type-signature"> : boolean</span> </h3>
  51. <div class="description">
  52. <p>If set to <code>true</code>, the texture is flipped along the vertical axis when
  53. uploaded to the GPU.</p>
  54. <p>Overwritten and set to <code>false</code> by default.<br/>Default is <code>false</code>.</p>
  55. </div>
  56. <dl class="details">
  57. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#flipY">Texture#flipY</a></dt>
  58. </dl>
  59. </div>
  60. <div class="member">
  61. <h3 class="name" id="generateMipmaps" translate="no">.<a href="#generateMipmaps">generateMipmaps</a><span class="type-signature"> : boolean</span> </h3>
  62. <div class="description">
  63. <p>Whether to generate mipmaps (if possible) for a texture.</p>
  64. <p>Overwritten and set to <code>false</code> by default.<br/>Default is <code>false</code>.</p>
  65. </div>
  66. <dl class="details">
  67. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#generateMipmaps">Texture#generateMipmaps</a></dt>
  68. </dl>
  69. </div>
  70. <div class="member">
  71. <h3 class="name" id="image" translate="no">.<a href="#image">image</a><span class="type-signature"> : Object</span> </h3>
  72. <div class="description">
  73. <p>The image definition of a data texture.</p>
  74. </div>
  75. <dl class="details">
  76. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#image">Texture#image</a></dt>
  77. </dl>
  78. </div>
  79. <div class="member">
  80. <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>
  81. <div class="description">
  82. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  83. </div>
  84. </div>
  85. <div class="member">
  86. <h3 class="name" id="layerUpdates" translate="no">.<a href="#layerUpdates">layerUpdates</a><span class="type-signature"> : Set.&lt;number></span> </h3>
  87. <div class="description">
  88. <p>A set of all layers which need to be updated in the texture.</p>
  89. </div>
  90. </div>
  91. <div class="member">
  92. <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>
  93. <div class="description">
  94. <p>How the texture is sampled when a texel covers more than one pixel.</p>
  95. <p>Overwritten and set to <code>NearestFilter</code> by default.<br/>Default is <code>NearestFilter</code>.</p>
  96. </div>
  97. <dl class="details">
  98. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#magFilter">Texture#magFilter</a></dt>
  99. </dl>
  100. </div>
  101. <div class="member">
  102. <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>
  103. <div class="description">
  104. <p>How the texture is sampled when a texel covers less than one pixel.</p>
  105. <p>Overwritten and set to <code>NearestFilter</code> by default.<br/>Default is <code>NearestFilter</code>.</p>
  106. </div>
  107. <dl class="details">
  108. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#minFilter">Texture#minFilter</a></dt>
  109. </dl>
  110. </div>
  111. <div class="member">
  112. <h3 class="name" id="unpackAlignment" translate="no">.<a href="#unpackAlignment">unpackAlignment</a><span class="type-signature"> : boolean</span> </h3>
  113. <div class="description">
  114. <p>Specifies the alignment requirements for the start of each pixel row in memory.</p>
  115. <p>Overwritten and set to <code>1</code> by default.<br/>Default is <code>1</code>.</p>
  116. </div>
  117. <dl class="details">
  118. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#unpackAlignment">Texture#unpackAlignment</a></dt>
  119. </dl>
  120. </div>
  121. <div class="member">
  122. <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>
  123. <div class="description">
  124. <p>This defines how the texture is wrapped in the depth and corresponds to
  125. <em>W</em> in UVW mapping.<br/>Default is <code>ClampToEdgeWrapping</code>.</p>
  126. </div>
  127. </div>
  128. <h2 class="subsection-title">Methods</h2>
  129. <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>
  130. <div class="method">
  131. <div class="description">
  132. <p>Describes that a specific layer of the texture needs to be updated.
  133. Normally when <a href="Texture.html#needsUpdate">Texture#needsUpdate</a> is set to <code>true</code>, the
  134. entire data texture array is sent to the GPU. Marking specific
  135. layers will only transmit subsets of all mipmaps associated with a
  136. specific depth in the array which is often much more performant.</p>
  137. </div>
  138. <table class="params">
  139. <tbody>
  140. <tr>
  141. <td class="name"><code>layerIndex</code></td>
  142. <td class="description last"><p>The layer index that should be updated.</p></td>
  143. </tr>
  144. </tbody>
  145. </table>
  146. </div>
  147. <h3 class="name name-method" id="clearLayerUpdates" translate="no">.<a href="#clearLayerUpdates">clearLayerUpdates</a><span class="signature">()</span> </h3>
  148. <div class="method">
  149. <div class="description">
  150. <p>Resets the layer updates registry.</p>
  151. </div>
  152. </div>
  153. <h2 class="subsection-title">Source</h2>
  154. <p>
  155. <a href="https://github.com/mrdoob/three.js/blob/master/src/textures/DataArrayTexture.js" target="_blank" rel="noopener" translate="no">src/textures/DataArrayTexture.js</a>
  156. </p>
  157. </article>
  158. </section>
  159. <script src="../scripts/linenumber.js"></script>
  160. <script src="../scripts/page.js"></script>
  161. </body>
  162. </html>
粤ICP备19079148号