HDRCubeTextureLoader.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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">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">LoadingManager</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"><code>manager</code></td>
  40. <td class="description last"><p>The loading manager.</p></td>
  41. </tr>
  42. </tbody>
  43. </table>
  44. </div>
  45. </div>
  46. <h2 class="subsection-title">Properties</h2>
  47. <div class="member">
  48. <h3 class="name" id="hdrLoader" translate="no">.<a href="#hdrLoader">hdrLoader</a><span class="type-signature"> : <a href="HDRLoader.html">HDRLoader</a></span> </h3>
  49. <div class="description">
  50. <p>The internal HDR loader that loads the
  51. individual textures for each cube face.</p>
  52. </div>
  53. </div>
  54. <div class="member">
  55. <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>
  56. <div class="description">
  57. <p>The texture type.<br/>Default is <code>HalfFloatType</code>.</p>
  58. </div>
  59. </div>
  60. <h2 class="subsection-title">Methods</h2>
  61. <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">onProgressCallback</span>, onError : <span class="param-type">onErrorCallback</span> )</span><span class="type-signature"> : <a href="CubeTexture.html">CubeTexture</a></span> </h3>
  62. <div class="method">
  63. <div class="description">
  64. <p>Starts loading from the given URLs and passes the loaded HDR cube texture
  65. to the <code>onLoad()</code> callback.</p>
  66. </div>
  67. <table class="params">
  68. <tbody>
  69. <tr>
  70. <td class="name"><code>urls</code></td>
  71. <td class="description last"><p>The paths/URLs of the files to be loaded. This can also be a data URIs.</p></td>
  72. </tr>
  73. <tr>
  74. <td class="name"><code>onLoad</code></td>
  75. <td class="description last"><p>Executed when the loading process has been finished.</p></td>
  76. </tr>
  77. <tr>
  78. <td class="name"><code>onProgress</code></td>
  79. <td class="description last"><p>Executed while the loading is in progress.</p></td>
  80. </tr>
  81. <tr>
  82. <td class="name"><code>onError</code></td>
  83. <td class="description last"><p>Executed when errors occur.</p></td>
  84. </tr>
  85. </tbody>
  86. </table>
  87. <dl class="details">
  88. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#load">Loader#load</a></dt>
  89. </dl>
  90. <dl class="details">
  91. <dt class="tag-returns"><strong>Returns:</strong> The HDR cube texture.</dt>
  92. </dl>
  93. </div>
  94. <h3 class="name name-method" id="setDataType" translate="no">.<a href="#setDataType">setDataType</a><span class="signature">( value : <span class="param-type">HalfFloatType | FloatType</span> )</span><span class="type-signature"> : <a href="HDRCubeTextureLoader.html">HDRCubeTextureLoader</a></span> </h3>
  95. <div class="method">
  96. <div class="description">
  97. <p>Sets the texture type.</p>
  98. </div>
  99. <table class="params">
  100. <tbody>
  101. <tr>
  102. <td class="name"><code>value</code></td>
  103. <td class="description last"><p>The texture type to set.</p></td>
  104. </tr>
  105. </tbody>
  106. </table>
  107. <dl class="details">
  108. <dt class="tag-returns"><strong>Returns:</strong> A reference to this loader.</dt>
  109. </dl>
  110. </div>
  111. <h2 class="subsection-title">Source</h2>
  112. <p>
  113. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/HDRCubeTextureLoader.js" target="_blank" rel="noopener" translate="no">examples/jsm/loaders/HDRCubeTextureLoader.js</a>
  114. </p>
  115. </article>
  116. </section>
  117. <script src="../scripts/linenumber.js"></script>
  118. <script src="../scripts/page.js"></script>
  119. </body>
  120. </html>
粤ICP备19079148号