UltraHDRLoader.html 7.5 KB

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