IESLoader.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>IESLoader - 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">IESLoader</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A loader for the IES format.</p>
  17. <p>The loaded texture should be assigned to <a href="IESSpotLight.html#map">IESSpotLight#map</a>.</p></div>
  18. <h2>Code Example</h2>
  19. <div translate="no"><pre><code class="language-js">const loader = new IESLoader();
  20. const texture = await loader.loadAsync( 'ies/007cfb11e343e2f42e3b476be4ab684e.ies' );
  21. const spotLight = new THREE.IESSpotLight( 0xff0000, 500 );
  22. spotLight.iesMap = texture;
  23. </code></pre></div>
  24. </header>
  25. <article>
  26. <h2 class="subsection-title">Import</h2>
  27. <p><span translate="no">IESLoader</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 { IESLoader } from 'three/addons/loaders/IESLoader.js';</code></pre>
  29. <div class="container-overview">
  30. <h2>Constructor</h2>
  31. <h3 class="name name-method" id="IESLoader" translate="no">new <a href="#IESLoader">IESLoader</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 IES 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="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>
  49. <div class="description">
  50. <p>The texture type.<br/>Default is <code>HalfFloatType</code>.</p>
  51. </div>
  52. </div>
  53. <h2 class="subsection-title">Methods</h2>
  54. <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> </h3>
  55. <div class="method">
  56. <div class="description">
  57. <p>Starts loading from the given URL and passes the loaded IES texture
  58. to the <code>onLoad()</code> callback.</p>
  59. </div>
  60. <table class="params">
  61. <tbody>
  62. <tr>
  63. <td class="name"><code>url</code></td>
  64. <td class="description last"><p>The path/URL of the file to be loaded. This can also be a data URI.</p></td>
  65. </tr>
  66. <tr>
  67. <td class="name"><code>onLoad</code></td>
  68. <td class="description last"><p>Executed when the loading process has been finished.</p></td>
  69. </tr>
  70. <tr>
  71. <td class="name"><code>onProgress</code></td>
  72. <td class="description last"><p>Executed while the loading is in progress.</p></td>
  73. </tr>
  74. <tr>
  75. <td class="name"><code>onError</code></td>
  76. <td class="description last"><p>Executed when errors occur.</p></td>
  77. </tr>
  78. </tbody>
  79. </table>
  80. <dl class="details">
  81. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#load">Loader#load</a></dt>
  82. </dl>
  83. </div>
  84. <h3 class="name name-method" id="parse" translate="no">.<a href="#parse">parse</a><span class="signature">( text : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="DataTexture.html">DataTexture</a></span> </h3>
  85. <div class="method">
  86. <div class="description">
  87. <p>Parses the given IES data.</p>
  88. </div>
  89. <table class="params">
  90. <tbody>
  91. <tr>
  92. <td class="name"><code>text</code></td>
  93. <td class="description last"><p>The raw IES data.</p></td>
  94. </tr>
  95. </tbody>
  96. </table>
  97. <dl class="details">
  98. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#parse">Loader#parse</a></dt>
  99. </dl>
  100. <dl class="details">
  101. <dt class="tag-returns"><strong>Returns:</strong> THE IES data as a texture.</dt>
  102. </dl>
  103. </div>
  104. <h2 class="subsection-title">Source</h2>
  105. <p>
  106. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/IESLoader.js" target="_blank" rel="noopener" translate="no">examples/jsm/loaders/IESLoader.js</a>
  107. </p>
  108. </article>
  109. </section>
  110. <script src="../scripts/linenumber.js"></script>
  111. <script src="../scripts/page.js"></script>
  112. </body>
  113. </html>
粤ICP备19079148号