RectAreaLight.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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 | Color | 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"><code>color</code></td>
  48. <td class="description last"><p>The light's color.<br/>Default is <code>0xffffff</code>.</p></td>
  49. </tr>
  50. <tr>
  51. <td class="name"><code>intensity</code></td>
  52. <td class="description last"><p>The light's strength/intensity.<br/>Default is <code>1</code>.</p></td>
  53. </tr>
  54. <tr>
  55. <td class="name"><code>width</code></td>
  56. <td class="description last"><p>The width of the light.<br/>Default is <code>10</code>.</p></td>
  57. </tr>
  58. <tr>
  59. <td class="name"><code>height</code></td>
  60. <td class="description last"><p>The height of the light.<br/>Default is <code>10</code>.</p></td>
  61. </tr>
  62. </tbody>
  63. </table>
  64. </div>
  65. </div>
  66. <h2 class="subsection-title">Properties</h2>
  67. <div class="member">
  68. <h3 class="name" id="height" translate="no">.<a href="#height">height</a><span class="type-signature"> : number</span> </h3>
  69. <div class="description">
  70. <p>The height of the light.<br/>Default is <code>10</code>.</p>
  71. </div>
  72. </div>
  73. <div class="member">
  74. <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>
  75. <div class="description">
  76. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  77. </div>
  78. </div>
  79. <div class="member">
  80. <h3 class="name" id="power" translate="no">.<a href="#power">power</a><span class="type-signature"> : number</span> </h3>
  81. <div class="description">
  82. <p>The light's power. Power is the luminous power of the light measured in lumens (lm).
  83. Changing the power will also change the light's intensity.</p>
  84. </div>
  85. </div>
  86. <div class="member">
  87. <h3 class="name" id="width" translate="no">.<a href="#width">width</a><span class="type-signature"> : number</span> </h3>
  88. <div class="description">
  89. <p>The width of the light.<br/>Default is <code>10</code>.</p>
  90. </div>
  91. </div>
  92. <h2 class="subsection-title">Source</h2>
  93. <p>
  94. <a href="https://github.com/mrdoob/three.js/blob/master/src/lights/RectAreaLight.js" target="_blank" rel="noopener" translate="no">src/lights/RectAreaLight.js</a>
  95. </p>
  96. </article>
  97. </section>
  98. <script src="../scripts/linenumber.js"></script>
  99. <script src="../scripts/page.js"></script>
  100. </body>
  101. </html>
粤ICP备19079148号