RectAreaLight.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>RectAreaLight - 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="EventDispatcher.html">EventDispatcher</a> → <a href="Object3D.html">Object3D</a> → <a href="Light.html">Light</a> → </p>
  13. <h1 translate="no">RectAreaLight</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This class emits light uniformly across the face a rectangular plane.
  17. This light type can be used to simulate light sources such as bright
  18. windows or strip lighting.</p>
  19. <p>Important Notes:</p>
  20. <ul>
  21. <li>There is no shadow support.</li>
  22. <li>Only PBR materials are supported.</li>
  23. <li>You have to include <code>RectAreaLightUniformsLib</code> (<code>WebGLRenderer</code>) or <code>RectAreaLightTexturesLib</code> (<code>WebGPURenderer</code>)
  24. into your app and init the uniforms/textures.</li>
  25. </ul></div>
  26. <h2>Code Example</h2>
  27. <div translate="no"><pre><code class="language-js">RectAreaLightUniformsLib.init(); // only relevant for WebGLRenderer
  28. THREE.RectAreaLightNode.setLTC( RectAreaLightTexturesLib.init() ); // only relevant for WebGPURenderer
  29. const intensity = 1; const width = 10; const height = 10;
  30. const rectLight = new THREE.RectAreaLight( 0xffffff, intensity, width, height );
  31. rectLight.position.set( 5, 5, 0 );
  32. rectLight.lookAt( 0, 0, 0 );
  33. scene.add( rectLight )
  34. </code></pre></div>
  35. </header>
  36. <article>
  37. <div class="container-overview">
  38. <h2>Constructor</h2>
  39. <h3 class="name name-method" id="RectAreaLight" translate="no">new <a href="#RectAreaLight">RectAreaLight</a><span class="signature">( color : <span class="param-type">number | <a href="Color.html">Color</a> | string</span>, intensity : <span class="param-type">number</span>, width : <span class="param-type">number</span>, height : <span class="param-type">number</span> )</span> </h3>
  40. <div class="method">
  41. <div class="description">
  42. <p>Constructs a new area light.</p>
  43. </div>
  44. <table class="params">
  45. <tbody>
  46. <tr>
  47. <td class="name">
  48. <strong>color</strong>
  49. </td>
  50. <td class="description last">
  51. <p>The light's color.</p>
  52. <p>Default is <code>0xffffff</code>.</p>
  53. </td>
  54. </tr>
  55. <tr>
  56. <td class="name">
  57. <strong>intensity</strong>
  58. </td>
  59. <td class="description last">
  60. <p>The light's strength/intensity.</p>
  61. <p>Default is <code>1</code>.</p>
  62. </td>
  63. </tr>
  64. <tr>
  65. <td class="name">
  66. <strong>width</strong>
  67. </td>
  68. <td class="description last">
  69. <p>The width of the light.</p>
  70. <p>Default is <code>10</code>.</p>
  71. </td>
  72. </tr>
  73. <tr>
  74. <td class="name">
  75. <strong>height</strong>
  76. </td>
  77. <td class="description last">
  78. <p>The height of the light.</p>
  79. <p>Default is <code>10</code>.</p>
  80. </td>
  81. </tr>
  82. </tbody>
  83. </table>
  84. </div>
  85. </div>
  86. <h2 class="subsection-title">Properties</h2>
  87. <div class="member">
  88. <h3 class="name" id="height" translate="no">.<a href="#height">height</a><span class="type-signature"> : number</span> </h3>
  89. <div class="description">
  90. <p>The height of the light.</p>
  91. <p>Default is <code>10</code>.</p>
  92. </div>
  93. </div>
  94. <div class="member">
  95. <h3 class="name" id="isRectAreaLight" translate="no">.<a href="#isRectAreaLight">isRectAreaLight</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  96. <div class="description">
  97. <p>This flag can be used for type testing.</p>
  98. <p>Default is <code>true</code>.</p>
  99. </div>
  100. </div>
  101. <div class="member">
  102. <h3 class="name" id="power" translate="no">.<a href="#power">power</a><span class="type-signature"> : number</span> </h3>
  103. <div class="description">
  104. <p>The light's power. Power is the luminous power of the light measured in lumens (lm).
  105. Changing the power will also change the light's intensity.</p>
  106. </div>
  107. </div>
  108. <div class="member">
  109. <h3 class="name" id="width" translate="no">.<a href="#width">width</a><span class="type-signature"> : number</span> </h3>
  110. <div class="description">
  111. <p>The width of the light.</p>
  112. <p>Default is <code>10</code>.</p>
  113. </div>
  114. </div>
  115. <h2 class="subsection-title">Source</h2>
  116. <p>
  117. <a href="https://github.com/mrdoob/three.js/blob/master/src/lights/RectAreaLight.js" translate="no" target="_blank" rel="noopener">src/lights/RectAreaLight.js</a>
  118. </p>
  119. </article>
  120. </section>
  121. <script src="../scripts/linenumber.js"></script>
  122. <script src="../scripts/page.js"></script>
  123. </body>
  124. </html>
粤ICP备19079148号