HDRLoader.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>HDRLoader - 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="DataTextureLoader.html">DataTextureLoader</a> → </p>
  13. <h1 translate="no">HDRLoader</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A loader for the RGBE HDR texture format.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const loader = new HDRLoader();
  19. const envMap = await loader.loadAsync( 'textures/equirectangular/blouberg_sunrise_2_1k.hdr' );
  20. envMap.mapping = THREE.EquirectangularReflectionMapping;
  21. scene.environment = envMap;
  22. </code></pre></div>
  23. </header>
  24. <article>
  25. <h2 class="subsection-title">Import</h2>
  26. <p><span translate="no">HDRLoader</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
  27. <pre><code class="language-js">import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';</code></pre>
  28. <div class="container-overview">
  29. <h2>Constructor</h2>
  30. <h3 class="name name-method" id="HDRLoader" translate="no">new <a href="#HDRLoader">HDRLoader</a><span class="signature">( manager : <span class="param-type">LoadingManager</span> )</span> </h3>
  31. <div class="method">
  32. <div class="description">
  33. <p>Constructs a new RGBE/HDR loader.</p>
  34. </div>
  35. <table class="params">
  36. <tbody>
  37. <tr>
  38. <td class="name"><code>manager</code></td>
  39. <td class="description last"><p>The loading manager.</p></td>
  40. </tr>
  41. </tbody>
  42. </table>
  43. </div>
  44. </div>
  45. <h2 class="subsection-title">Properties</h2>
  46. <div class="member">
  47. <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>
  48. <div class="description">
  49. <p>The texture type.<br/>Default is <code>HalfFloatType</code>.</p>
  50. </div>
  51. </div>
  52. <h2 class="subsection-title">Methods</h2>
  53. <h3 class="name name-method" id="parse" translate="no">.<a href="#parse">parse</a><span class="signature">( buffer : <span class="param-type">ArrayBuffer</span> )</span><span class="type-signature"> : <a href="DataTextureLoader.html#~TexData">DataTextureLoader~TexData</a></span> </h3>
  54. <div class="method">
  55. <div class="description">
  56. <p>Parses the given RGBE texture data.</p>
  57. </div>
  58. <table class="params">
  59. <tbody>
  60. <tr>
  61. <td class="name"><code>buffer</code></td>
  62. <td class="description last"><p>The raw texture data.</p></td>
  63. </tr>
  64. </tbody>
  65. </table>
  66. <dl class="details">
  67. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="DataTextureLoader.html#parse">DataTextureLoader#parse</a></dt>
  68. </dl>
  69. <dl class="details">
  70. <dt class="tag-returns"><strong>Returns:</strong> An object representing the parsed texture data.</dt>
  71. </dl>
  72. </div>
  73. <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="HDRLoader.html">HDRLoader</a></span> </h3>
  74. <div class="method">
  75. <div class="description">
  76. <p>Sets the texture type.</p>
  77. </div>
  78. <table class="params">
  79. <tbody>
  80. <tr>
  81. <td class="name"><code>value</code></td>
  82. <td class="description last"><p>The texture type to set.</p></td>
  83. </tr>
  84. </tbody>
  85. </table>
  86. <dl class="details">
  87. <dt class="tag-returns"><strong>Returns:</strong> A reference to this loader.</dt>
  88. </dl>
  89. </div>
  90. <h2 class="subsection-title">Source</h2>
  91. <p>
  92. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/HDRLoader.js" target="_blank" rel="noopener" translate="no">examples/jsm/loaders/HDRLoader.js</a>
  93. </p>
  94. </article>
  95. </section>
  96. <script src="../scripts/linenumber.js"></script>
  97. <script src="../scripts/page.js"></script>
  98. </body>
  99. </html>
粤ICP备19079148号