HDRCubeTextureLoader.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>HDRCubeTextureLoader - 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> → </p>
  13. <h1 translate="no">HDRCubeTextureLoader</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A loader for loading HDR cube textures.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const loader = new HDRCubeTextureLoader();
  19. loader.setPath( 'textures/cube/pisaHDR/' );
  20. const cubeTexture = await loader.loadAsync( [ 'px.hdr', 'nx.hdr', 'py.hdr', 'ny.hdr', 'pz.hdr', 'nz.hdr' ] );
  21. scene.background = cubeTexture;
  22. scene.environment = cubeTexture;
  23. </code></pre></div>
  24. </header>
  25. <article>
  26. <h2 class="subsection-title">Import</h2>
  27. <p><span translate="no">HDRCubeTextureLoader</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>
  28. <pre><code class="language-js">import { HDRCubeTextureLoader } from 'three/addons/loaders/HDRCubeTextureLoader.js';</code></pre>
  29. <div class="container-overview">
  30. <h2>Constructor</h2>
  31. <h3 class="name name-method" id="HDRCubeTextureLoader" translate="no">new <a href="#HDRCubeTextureLoader">HDRCubeTextureLoader</a><span class="signature">( manager : <span class="param-type"><a href="LoadingManager.html">LoadingManager</a></span> )</span> </h3>
  32. <div class="method">
  33. <div class="description">
  34. <p>Constructs a new HDR cube texture loader.</p>
  35. </div>
  36. <table class="params">
  37. <tbody>
  38. <tr>
  39. <td class="name">
  40. <strong>manager</strong>
  41. </td>
  42. <td class="description last">
  43. <p>The loading manager.</p>
  44. </td>
  45. </tr>
  46. </tbody>
  47. </table>
  48. </div>
  49. </div>
  50. <h2 class="subsection-title">Properties</h2>
  51. <div class="member">
  52. <h3 class="name" id="hdrLoader" translate="no">.<a href="#hdrLoader">hdrLoader</a><span class="type-signature"> : <a href="HDRLoader.html">HDRLoader</a></span> </h3>
  53. <div class="description">
  54. <p>The internal HDR loader that loads the
  55. individual textures for each cube face.</p>
  56. </div>
  57. </div>
  58. <div class="member">
  59. <h3 class="name" id="type" translate="no">.<a href="#type">type</a><span class="type-signature"> : <a href="global.html#HalfFloatType">HalfFloatType</a> | <a href="global.html#FloatType">FloatType</a></span> </h3>
  60. <div class="description">
  61. <p>The texture type.</p>
  62. <p>Default is <code>HalfFloatType</code>.</p>
  63. </div>
  64. </div>
  65. <h2 class="subsection-title">Methods</h2>
  66. <h3 class="name name-method" id="load" translate="no">.<a href="#load">load</a><span class="signature">( urls : <span class="param-type">Array.&lt;string></span>, onLoad : <span class="param-type">function</span>, onProgress : <span class="param-type"><a href="global.html#onProgressCallback">onProgressCallback</a></span>, onError : <span class="param-type"><a href="global.html#onErrorCallback">onErrorCallback</a></span> )</span><span class="type-signature"> : <a href="CubeTexture.html">CubeTexture</a></span> </h3>
  67. <div class="method">
  68. <div class="description">
  69. <p>Starts loading from the given URLs and passes the loaded HDR cube texture
  70. to the <code>onLoad()</code> callback.</p>
  71. </div>
  72. <table class="params">
  73. <tbody>
  74. <tr>
  75. <td class="name">
  76. <strong>urls</strong>
  77. </td>
  78. <td class="description last">
  79. <p>The paths/URLs of the files to be loaded. This can also be a data URIs.</p>
  80. </td>
  81. </tr>
  82. <tr>
  83. <td class="name">
  84. <strong>onLoad</strong>
  85. </td>
  86. <td class="description last">
  87. <p>Executed when the loading process has been finished.</p>
  88. </td>
  89. </tr>
  90. <tr>
  91. <td class="name">
  92. <strong>onProgress</strong>
  93. </td>
  94. <td class="description last">
  95. <p>Executed while the loading is in progress.</p>
  96. </td>
  97. </tr>
  98. <tr>
  99. <td class="name">
  100. <strong>onError</strong>
  101. </td>
  102. <td class="description last">
  103. <p>Executed when errors occur.</p>
  104. </td>
  105. </tr>
  106. </tbody>
  107. </table>
  108. <dl class="details">
  109. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#load">Loader#load</a></dt>
  110. </dl>
  111. <dl class="details">
  112. <dt class="tag-returns"><strong>Returns:</strong> The HDR cube texture.</dt>
  113. </dl>
  114. </div>
  115. <h3 class="name name-method" id="setDataType" translate="no">.<a href="#setDataType">setDataType</a><span class="signature">( value : <span class="param-type"><a href="global.html#HalfFloatType">HalfFloatType</a> | <a href="global.html#FloatType">FloatType</a></span> )</span><span class="type-signature"> : <a href="HDRCubeTextureLoader.html">HDRCubeTextureLoader</a></span> </h3>
  116. <div class="method">
  117. <div class="description">
  118. <p>Sets the texture type.</p>
  119. </div>
  120. <table class="params">
  121. <tbody>
  122. <tr>
  123. <td class="name">
  124. <strong>value</strong>
  125. </td>
  126. <td class="description last">
  127. <p>The texture type to set.</p>
  128. </td>
  129. </tr>
  130. </tbody>
  131. </table>
  132. <dl class="details">
  133. <dt class="tag-returns"><strong>Returns:</strong> A reference to this loader.</dt>
  134. </dl>
  135. </div>
  136. <h2 class="subsection-title">Source</h2>
  137. <p>
  138. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/HDRCubeTextureLoader.js" translate="no" target="_blank" rel="noopener">examples/jsm/loaders/HDRCubeTextureLoader.js</a>
  139. </p>
  140. </article>
  141. </section>
  142. <script src="../scripts/linenumber.js"></script>
  143. <script src="../scripts/page.js"></script>
  144. </body>
  145. </html>
粤ICP备19079148号