KTX2Exporter.html 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>KTX2Exporter - 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. <h1 translate="no">KTX2Exporter</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>An exporter for KTX2.</p></div>
  16. <h2>Code Example</h2>
  17. <div translate="no"><pre><code class="language-js">const exporter = new KTX2Exporter();
  18. const result = await exporter.parse( dataTexture );
  19. </code></pre></div>
  20. </header>
  21. <article>
  22. <h2 class="subsection-title">Import</h2>
  23. <p><span translate="no">KTX2Exporter</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
  24. <pre><code class="language-js">import { KTX2Exporter } from 'three/addons/exporters/KTX2Exporter.js';</code></pre>
  25. <div class="container-overview">
  26. <h2>Constructor</h2>
  27. <h3 class="name name-method" id="KTX2Exporter" translate="no">new <a href="#KTX2Exporter">KTX2Exporter</a><span class="signature">()</span> </h3>
  28. <div class="method">
  29. </div>
  30. </div>
  31. <h2 class="subsection-title">Methods</h2>
  32. <h3 class="name name-method" id="parse" translate="no">.<a href="#parse">parse</a><span class="signature">( arg1 : <span class="param-type"><a href="DataTexture.html">DataTexture</a> | <a href="Data3DTexture.html">Data3DTexture</a> | <a href="WebGPURenderer.html">WebGPURenderer</a> | <a href="WebGLRenderer.html">WebGLRenderer</a></span>, arg2 : <span class="param-type"><a href="RenderTarget.html">RenderTarget</a></span> )</span><span class="type-signature"> : Promise.&lt;Uint8Array></span> <span class="type-signature">(async) </span></h3>
  33. <div class="method">
  34. <div class="description">
  35. <p>This method has two variants.</p>
  36. <ul>
  37. <li>When exporting a data texture, it receives one parameter. The data or 3D data texture.</li>
  38. <li>When exporting a render target (e.g. a PMREM), it receives two parameters. The renderer and the
  39. render target.</li>
  40. </ul>
  41. </div>
  42. <table class="params">
  43. <tbody>
  44. <tr>
  45. <td class="name">
  46. <strong>arg1</strong>
  47. </td>
  48. <td class="description last">
  49. <p>The data texture to export or a renderer.</p>
  50. </td>
  51. </tr>
  52. <tr>
  53. <td class="name">
  54. <strong>arg2</strong>
  55. </td>
  56. <td class="description last">
  57. <p>The render target that should be exported</p>
  58. </td>
  59. </tr>
  60. </tbody>
  61. </table>
  62. <dl class="details">
  63. <dt class="tag-returns"><strong>Returns:</strong> A Promise that resolves with the exported KTX2.</dt>
  64. </dl>
  65. </div>
  66. <h2 class="subsection-title">Source</h2>
  67. <p>
  68. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/exporters/KTX2Exporter.js" translate="no" target="_blank" rel="noopener">examples/jsm/exporters/KTX2Exporter.js</a>
  69. </p>
  70. </article>
  71. </section>
  72. <script src="../scripts/linenumber.js"></script>
  73. <script src="../scripts/page.js"></script>
  74. </body>
  75. </html>
粤ICP备19079148号