| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>RectAreaLight - Three.js Docs</title>
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <script src="../scripts/highlight.min.js"></script>
- <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
- <link type="text/css" rel="stylesheet" href="../styles/page.css">
- </head>
- <body>
- <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Object3D.html">Object3D</a> → <a href="Light.html">Light</a> → </p>
- <h1 translate="no">RectAreaLight</h1>
- <section>
- <header>
- <div class="class-description"><p>This class emits light uniformly across the face a rectangular plane.
- This light type can be used to simulate light sources such as bright
- windows or strip lighting.</p>
- <p>Important Notes:</p>
- <ul>
- <li>There is no shadow support.</li>
- <li>Only PBR materials are supported.</li>
- <li>You have to include <code>RectAreaLightUniformsLib</code> (<code>WebGLRenderer</code>) or <code>RectAreaLightTexturesLib</code> (<code>WebGPURenderer</code>)
- into your app and init the uniforms/textures.</li>
- </ul></div>
- <h2>Code Example</h2>
- <div translate="no"><pre><code class="language-js">RectAreaLightUniformsLib.init(); // only relevant for WebGLRenderer
- THREE.RectAreaLightNode.setLTC( RectAreaLightTexturesLib.init() ); // only relevant for WebGPURenderer
- const intensity = 1; const width = 10; const height = 10;
- const rectLight = new THREE.RectAreaLight( 0xffffff, intensity, width, height );
- rectLight.position.set( 5, 5, 0 );
- rectLight.lookAt( 0, 0, 0 );
- scene.add( rectLight )
- </code></pre></div>
- </header>
- <article>
- <div class="container-overview">
- <h2>Constructor</h2>
- <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>
- <div class="method">
- <div class="description">
- <p>Constructs a new area light.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>color</strong>
- </td>
- <td class="description last">
- <p>The light's color.</p>
- <p>Default is <code>0xffffff</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>intensity</strong>
- </td>
- <td class="description last">
- <p>The light's strength/intensity.</p>
- <p>Default is <code>1</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>width</strong>
- </td>
- <td class="description last">
- <p>The width of the light.</p>
- <p>Default is <code>10</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>height</strong>
- </td>
- <td class="description last">
- <p>The height of the light.</p>
- <p>Default is <code>10</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <h2 class="subsection-title">Properties</h2>
- <div class="member">
- <h3 class="name" id="height" translate="no">.<a href="#height">height</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The height of the light.</p>
- <p>Default is <code>10</code>.</p>
- </div>
- </div>
- <div class="member">
- <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>
- <div class="description">
- <p>This flag can be used for type testing.</p>
- <p>Default is <code>true</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="power" translate="no">.<a href="#power">power</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The light's power. Power is the luminous power of the light measured in lumens (lm).
- Changing the power will also change the light's intensity.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="width" translate="no">.<a href="#width">width</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The width of the light.</p>
- <p>Default is <code>10</code>.</p>
- </div>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <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>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|