DDSLoader.html 3.6 KB

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