UltraHDRLoader.html 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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 (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" rel="noopener">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"><a href="LoadingManager.html">LoadingManager</a></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">
  53. <strong>manager</strong>
  54. </td>
  55. <td class="description last">
  56. <p>The loading manager.</p>
  57. </td>
  58. </tr>
  59. </tbody>
  60. </table>
  61. </div>
  62. </div>
  63. <h2 class="subsection-title">Properties</h2>
  64. <div class="member">
  65. <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>
  66. <div class="description">
  67. <p>The texture type.</p>
  68. <p>Default is <code>HalfFloatType</code>.</p>
  69. </div>
  70. </div>
  71. <h2 class="subsection-title">Methods</h2>
  72. <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>
  73. <div class="method">
  74. <div class="description">
  75. <p>Starts loading from the given URL and passes the loaded Ultra HDR texture
  76. to the <code>onLoad()</code> callback.</p>
  77. </div>
  78. <table class="params">
  79. <tbody>
  80. <tr>
  81. <td class="name">
  82. <strong>url</strong>
  83. </td>
  84. <td class="description last">
  85. <p>The path/URL of the files to be loaded. This can also be a data URI.</p>
  86. </td>
  87. </tr>
  88. <tr>
  89. <td class="name">
  90. <strong>onLoad</strong>
  91. </td>
  92. <td class="description last">
  93. <p>Executed when the loading process has been finished.</p>
  94. </td>
  95. </tr>
  96. <tr>
  97. <td class="name">
  98. <strong>onProgress</strong>
  99. </td>
  100. <td class="description last">
  101. <p>Executed while the loading is in progress.</p>
  102. </td>
  103. </tr>
  104. <tr>
  105. <td class="name">
  106. <strong>onError</strong>
  107. </td>
  108. <td class="description last">
  109. <p>Executed when errors occur.</p>
  110. </td>
  111. </tr>
  112. </tbody>
  113. </table>
  114. <dl class="details">
  115. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#load">Loader#load</a></dt>
  116. </dl>
  117. <dl class="details">
  118. <dt class="tag-returns"><strong>Returns:</strong> The Ultra HDR texture.</dt>
  119. </dl>
  120. </div>
  121. <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>
  122. <div class="method">
  123. <div class="description">
  124. <p>Parses the given Ultra HDR texture data.</p>
  125. </div>
  126. <table class="params">
  127. <tbody>
  128. <tr>
  129. <td class="name">
  130. <strong>buffer</strong>
  131. </td>
  132. <td class="description last">
  133. <p>The raw texture data.</p>
  134. </td>
  135. </tr>
  136. <tr>
  137. <td class="name">
  138. <strong>onLoad</strong>
  139. </td>
  140. <td class="description last">
  141. <p>The <code>onLoad</code> callback.</p>
  142. </td>
  143. </tr>
  144. </tbody>
  145. </table>
  146. <dl class="details">
  147. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#parse">Loader#parse</a></dt>
  148. </dl>
  149. </div>
  150. <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>
  151. <div class="method">
  152. <div class="description">
  153. <p>Sets the texture type.</p>
  154. </div>
  155. <table class="params">
  156. <tbody>
  157. <tr>
  158. <td class="name">
  159. <strong>value</strong>
  160. </td>
  161. <td class="description last">
  162. <p>The texture type to set.</p>
  163. </td>
  164. </tr>
  165. </tbody>
  166. </table>
  167. <dl class="details">
  168. <dt class="tag-returns"><strong>Returns:</strong> A reference to this loader.</dt>
  169. </dl>
  170. </div>
  171. <h2 class="subsection-title">Source</h2>
  172. <p>
  173. <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>
  174. </p>
  175. </article>
  176. </section>
  177. <script src="../scripts/linenumber.js"></script>
  178. <script src="../scripts/page.js"></script>
  179. </body>
  180. </html>
粤ICP备19079148号