1
0

KTXLoader.html 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>KTXLoader - 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="Loader.html">Loader</a> → <a href="CompressedTextureLoader.html">CompressedTextureLoader</a> → </p>
  13. <h1 translate="no">KTXLoader</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A loader for the KTX texture compression format.</p>
  17. <p>References:</p>
  18. <ul>
  19. <li><a href="https://www.khronos.org/opengles/sdk/tools/KTX/">The KTX File Format and Tools</a></li>
  20. <li><a href="https://github.com/BabylonJS/Babylon.js/blob/master/src/Misc/khronosTextureContainer.ts">Babylon.JS khronosTextureContainer.ts</a></li>
  21. </ul></div>
  22. <h2>Code Example</h2>
  23. <div translate="no"><pre><code class="language-js">const loader = new KTXLoader();
  24. const map = loader.load( 'textures/compressed/lensflare_ASTC8x8.ktx' )
  25. map.colorSpace = THREE.SRGBColorSpace; // only for color textures
  26. </code></pre></div>
  27. </header>
  28. <article>
  29. <h2 class="subsection-title">Import</h2>
  30. <p><span translate="no">KTXLoader</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
  31. <pre><code class="language-js">import { KTXLoader } from 'three/addons/loaders/KTXLoader.js';</code></pre>
  32. <div class="container-overview">
  33. <h2>Constructor</h2>
  34. <h3 class="name name-method" id="KTXLoader" translate="no">new <a href="#KTXLoader">KTXLoader</a><span class="signature">( manager : <span class="param-type">LoadingManager</span> )</span> </h3>
  35. <div class="method">
  36. <div class="description">
  37. <p>Constructs a new KTX loader.</p>
  38. </div>
  39. <table class="params">
  40. <tbody>
  41. <tr>
  42. <td class="name"><code>manager</code></td>
  43. <td class="description last"><p>The loading manager.</p></td>
  44. </tr>
  45. </tbody>
  46. </table>
  47. </div>
  48. </div>
  49. <h2 class="subsection-title">Methods</h2>
  50. <h3 class="name name-method" id="parse" translate="no">.<a href="#parse">parse</a><span class="signature">( buffer : <span class="param-type">ArrayBuffer</span>, loadMipmaps : <span class="param-type">boolean</span> )</span><span class="type-signature"> : <a href="CompressedTextureLoader.html#~TexData">CompressedTextureLoader~TexData</a></span> </h3>
  51. <div class="method">
  52. <div class="description">
  53. <p>Parses the given KTX texture data.</p>
  54. </div>
  55. <table class="params">
  56. <tbody>
  57. <tr>
  58. <td class="name"><code>buffer</code></td>
  59. <td class="description last"><p>The raw texture data.</p></td>
  60. </tr>
  61. <tr>
  62. <td class="name"><code>loadMipmaps</code></td>
  63. <td class="description last"><p>Whether to load mipmaps or not.</p></td>
  64. </tr>
  65. </tbody>
  66. </table>
  67. <dl class="details">
  68. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="CompressedTextureLoader.html#parse">CompressedTextureLoader#parse</a></dt>
  69. </dl>
  70. <dl class="details">
  71. <dt class="tag-returns"><strong>Returns:</strong> An object representing the parsed texture data.</dt>
  72. </dl>
  73. </div>
  74. <h2 class="subsection-title">Source</h2>
  75. <p>
  76. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/KTXLoader.js" target="_blank" rel="noopener" translate="no">examples/jsm/loaders/KTXLoader.js</a>
  77. </p>
  78. </article>
  79. </section>
  80. <script src="../scripts/linenumber.js"></script>
  81. <script src="../scripts/page.js"></script>
  82. </body>
  83. </html>
粤ICP备19079148号