PVRLoader.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>PVRLoader - 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">PVRLoader</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A loader for the PVRTC texture compression format.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const loader = new PVRLoader();
  19. const map = loader.load( 'textures/compressed/disturb_4bpp_rgb.pvr' );
  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">PVRLoader</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>
  26. <pre><code class="language-js">import { PVRLoader } from 'three/addons/loaders/PVRLoader.js';</code></pre>
  27. <div class="container-overview">
  28. <h2>Constructor</h2>
  29. <h3 class="name name-method" id="PVRLoader" translate="no">new <a href="#PVRLoader">PVRLoader</a><span class="signature">( manager : <span class="param-type"><a href="LoadingManager.html">LoadingManager</a></span> )</span> </h3>
  30. <div class="method">
  31. <div class="description">
  32. <p>Constructs a new PVR loader.</p>
  33. </div>
  34. <table class="params">
  35. <tbody>
  36. <tr>
  37. <td class="name">
  38. <strong>manager</strong>
  39. </td>
  40. <td class="description last">
  41. <p>The loading manager.</p>
  42. </td>
  43. </tr>
  44. </tbody>
  45. </table>
  46. </div>
  47. </div>
  48. <h2 class="subsection-title">Methods</h2>
  49. <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>
  50. <div class="method">
  51. <div class="description">
  52. <p>Parses the given PVRTC texture data.</p>
  53. </div>
  54. <table class="params">
  55. <tbody>
  56. <tr>
  57. <td class="name">
  58. <strong>buffer</strong>
  59. </td>
  60. <td class="description last">
  61. <p>The raw texture data.</p>
  62. </td>
  63. </tr>
  64. <tr>
  65. <td class="name">
  66. <strong>loadMipmaps</strong>
  67. </td>
  68. <td class="description last">
  69. <p>Whether to load mipmaps or not. This option is not yet supported by the loader.</p>
  70. </td>
  71. </tr>
  72. </tbody>
  73. </table>
  74. <dl class="details">
  75. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="CompressedTextureLoader.html#parse">CompressedTextureLoader#parse</a></dt>
  76. </dl>
  77. <dl class="details">
  78. <dt class="tag-returns"><strong>Returns:</strong> An object representing the parsed texture data.</dt>
  79. </dl>
  80. </div>
  81. <h2 class="subsection-title">Source</h2>
  82. <p>
  83. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/PVRLoader.js" translate="no" target="_blank" rel="noopener">examples/jsm/loaders/PVRLoader.js</a>
  84. </p>
  85. </article>
  86. </section>
  87. <script src="../scripts/linenumber.js"></script>
  88. <script src="../scripts/page.js"></script>
  89. </body>
  90. </html>
粤ICP备19079148号