UltraHDRLoader.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>UltraHDRLoader - 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">UltraHDRLoader</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A loader for the Ultra HDR Image Format.</p>
  17. <p>Existing HDR or EXR textures can be converted to Ultra HDR with this <a href="https://gainmap-creator.monogrid.com/">tool</a>.</p>
  18. <p>Current feature set:</p>
  19. <ul>
  20. <li>JPEG headers (required)</li>
  21. <li>XMP metadata (required)</li>
  22. <li>XMP validation (not implemented)</li>
  23. <li>EXIF profile (not implemented)</li>
  24. <li>ICC profile (not implemented)</li>
  25. <li>Binary storage for SDR &amp; HDR images (required)</li>
  26. <li>Gainmap metadata (required)</li>
  27. <li>Non-JPEG image formats (not implemented)</li>
  28. <li>Primary image as an HDR image (not implemented)</li>
  29. </ul></div>
  30. <h2>Code Example</h2>
  31. <div translate="no"><pre><code class="language-js">const loader = new UltraHDRLoader();
  32. const texture = await loader.loadAsync( 'textures/equirectangular/ice_planet_close.jpg' );
  33. texture.mapping = THREE.EquirectangularReflectionMapping;
  34. scene.background = texture;
  35. scene.environment = texture;
  36. </code></pre></div>
  37. </header>
  38. <article>
  39. <h2 class="subsection-title">Import</h2>
  40. <p><span translate="no">UltraHDRLoader</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
  41. <pre><code class="language-js">import { UltraHDRLoader } from 'three/addons/loaders/UltraHDRLoader.js';</code></pre>
  42. <div class="container-overview">
  43. <h2>Constructor</h2>
  44. <h3 class="name name-method" id="UltraHDRLoader" translate="no">new <a href="#UltraHDRLoader">UltraHDRLoader</a><span class="signature">( manager : <span class="param-type">LoadingManager</span> )</span> </h3>
  45. <div class="method">
  46. <div class="description">
  47. <p>Constructs a new Ultra HDR loader.</p>
  48. </div>
  49. <table class="params">
  50. <tbody>
  51. <tr>
  52. <td class="name"><code>manager</code></td>
  53. <td class="description last"><p>The loading manager.</p></td>
  54. </tr>
  55. </tbody>
  56. </table>
  57. </div>
  58. </div>
  59. <h2 class="subsection-title">Properties</h2>
  60. <div class="member">
  61. <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>
  62. <div class="description">
  63. <p>The texture type.<br/>Default is <code>HalfFloatType</code>.</p>
  64. </div>
  65. </div>
  66. <h2 class="subsection-title">Methods</h2>
  67. <h3 class="name name-method" id="load" translate="no">.<a href="#load">load</a><span class="signature">( url : <span class="param-type">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="DataTexture.html">DataTexture</a></span> </h3>
  68. <div class="method">
  69. <div class="description">
  70. <p>Starts loading from the given URL and passes the loaded Ultra HDR texture
  71. to the <code>onLoad()</code> callback.</p>
  72. </div>
  73. <table class="params">
  74. <tbody>
  75. <tr>
  76. <td class="name"><code>url</code></td>
  77. <td class="description last"><p>The path/URL of the files to be loaded. This can also be a data URI.</p></td>
  78. </tr>
  79. <tr>
  80. <td class="name"><code>onLoad</code></td>
  81. <td class="description last"><p>Executed when the loading process has been finished.</p></td>
  82. </tr>
  83. <tr>
  84. <td class="name"><code>onProgress</code></td>
  85. <td class="description last"><p>Executed while the loading is in progress.</p></td>
  86. </tr>
  87. <tr>
  88. <td class="name"><code>onError</code></td>
  89. <td class="description last"><p>Executed when errors occur.</p></td>
  90. </tr>
  91. </tbody>
  92. </table>
  93. <dl class="details">
  94. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#load">Loader#load</a></dt>
  95. </dl>
  96. <dl class="details">
  97. <dt class="tag-returns"><strong>Returns:</strong> The Ultra HDR texture.</dt>
  98. </dl>
  99. </div>
  100. <h3 class="name name-method" id="parse" translate="no">.<a href="#parse">parse</a><span class="signature">( buffer : <span class="param-type">ArrayBuffer</span>, onLoad : <span class="param-type">function</span> )</span> </h3>
  101. <div class="method">
  102. <div class="description">
  103. <p>Parses the given Ultra HDR texture data.</p>
  104. </div>
  105. <table class="params">
  106. <tbody>
  107. <tr>
  108. <td class="name"><code>buffer</code></td>
  109. <td class="description last"><p>The raw texture data.</p></td>
  110. </tr>
  111. <tr>
  112. <td class="name"><code>onLoad</code></td>
  113. <td class="description last"><p>The <code>onLoad</code> callback.</p></td>
  114. </tr>
  115. </tbody>
  116. </table>
  117. <dl class="details">
  118. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#parse">Loader#parse</a></dt>
  119. </dl>
  120. </div>
  121. <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="UltraHDRLoader.html">UltraHDRLoader</a></span> </h3>
  122. <div class="method">
  123. <div class="description">
  124. <p>Sets the texture type.</p>
  125. </div>
  126. <table class="params">
  127. <tbody>
  128. <tr>
  129. <td class="name"><code>value</code></td>
  130. <td class="description last"><p>The texture type to set.</p></td>
  131. </tr>
  132. </tbody>
  133. </table>
  134. <dl class="details">
  135. <dt class="tag-returns"><strong>Returns:</strong> A reference to this loader.</dt>
  136. </dl>
  137. </div>
  138. <h2 class="subsection-title">Source</h2>
  139. <p>
  140. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/UltraHDRLoader.js" target="_blank" rel="noopener" translate="no">examples/jsm/loaders/UltraHDRLoader.js</a>
  141. </p>
  142. </article>
  143. </section>
  144. <script src="../scripts/linenumber.js"></script>
  145. <script src="../scripts/page.js"></script>
  146. </body>
  147. </html>
粤ICP备19079148号