123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <base href="../../" />
- <script src="list.js"></script>
- <script src="page.js"></script>
- <link type="text/css" rel="stylesheet" href="page.css" />
- </head>
- <body>
- [page:Object3D] → [page:Light] →
- <h1>[name]</h1>
- <div class="desc">
- Affects objects using [page:MeshLambertMaterial] or [page:MeshPhongMaterial].
- </div>
- <h2>Example</h2>
- <div>[example:canvas_morphtargets_horse morphtargets / horse ]</div>
- <div>[example:misc_controls_fly controls / fly ]</div>
- <div>[example:misc_lights_test lights / test ]</div>
- <div>[example:vr_cubes cubes ]</div>
- <div>[example:webgl_effects_parallaxbarrier effects / parallaxbarrier ]</div>
- <div>[example:webgl_effects_stereo effects / stereo ]</div>
- <div>[example:webgl_geometry_extrude_splines geometry / extrude / splines ]</div>
- <div>[example:webgl_materials_bumpmap materials / bumpmap ]</div>
- <div>[example:webgl_materials_cubemap_balls_reflection materials / cubemap / balls / reflection ]</div>
- <code>// White directional light at half intensity shining from the top.
- var directionalLight = new THREE.DirectionalLight( 0xffffff, 0.5 );
- directionalLight.position.set( 0, 1, 0 );
- scene.add( directionalLight );</code>
- <h2>Constructor</h2>
- <h3>[name]([page:Integer hex], [page:Float intensity])</h3>
- <div>
- [page:Integer hex] -- Numeric value of the RGB component of the color. <br />
- [page:Float intensity] -- Numeric value of the light's strength/intensity.
- </div>
- <div>
- Creates a light that shines from a specific direction not from a specific position. This light will behave
- as though it is infinitely far away and the rays produced from it are all parallel. The best
- analogy would be a light source that acts like the sun: the sun is so far away that all sunlight
- hitting objects comes from the same angle.
- </div>
- <h2>Properties</h2>
- <h3>[property:Object3D target]</h3>
- <div>
- Target used for shadow camera orientation.
- </div>
- <h3>[property:Float intensity]</h3>
- <div>
- Light's intensity.<br />
- Default — *1.0*.
- </div>
- <h3>[property:Boolean onlyShadow]</h3>
- <div>
- If set to *true* light will only cast shadow but not contribute any lighting (as if *intensity* was 0 but cheaper to compute).<br />
- Default — *false*.
- </div>
- <h3>[property:Boolean castShadow]</h3>
- <div>
- If set to true light will cast dynamic shadows. Warning: This is expensive and requires tweaking to get shadows looking right.<br />
- Default — *false*.
- </div>
- <h3>[property:Float shadowCameraNear]</h3>
- <div>
- Orthographic shadow camera frustum parameter.<br />
- Default — *50*.
- </div>
- <h3>[property:Float shadowCameraFar]</h3>
- <div>
- Orthographic shadow camera frustum parameter.<br />
- Default — *5000*.
- </div>
- <h3>[property:Float shadowCameraLeft]</h3>
- <div>
- Orthographic shadow camera frustum parameter.<br />
- Default — *-500*.
- </div>
- <h3>[property:Float shadowCameraRight]</h3>
- <div>
- Orthographic shadow camera frustum parameter.<br />
- Default — *500*.
- </div>
- <h3>[property:Float shadowCameraTop]</h3>
- <div>
- Orthographic shadow camera frustum parameter.<br />
- Default — *500*.
- </div>
- <h3>[property:Float shadowCameraBottom]</h3>
- <div>
- Orthographic shadow camera frustum parameter.<br />
- Default — *-500*.
- </div>
- <h3>[property:Boolean shadowCameraVisible]</h3>
- <div>
- Show debug shadow camera frustum.<br />
- Default — *false*.
- </div>
- <h3>[property:Float shadowBias]</h3>
- <div>
- Shadow map bias, how much to add or subtract from the normalized depth when deciding whether a surface is in shadow.<br />
- Default — *0*.
- </div>
- <h3>[property:Integer shadowMapWidth]</h3>
- <div>
- Shadow map texture width in pixels.<br />
- Default — *512*.
- </div>
- <h3>[property:Integer shadowMapHeight]</h3>
- <div>
- Shadow map texture height in pixels.<br />
- Default — *512*.
- </div>
- <h3>[property:Vector2 shadowMapSize]</h3>
- <div>
- The shadowMapWidth and shadowMapHeight stored in a [page:Vector2 THREE.Vector2]. Set internally during rendering.
- </div>
- <h3>[property:OrthographicCamera shadowCamera]</h3>
- <div>
- The shadow's view of the world. Computed internally during rendering from the shadowCamera* settings.
- </div>
- <h3>[property:Matrix4 shadowMatrix]</h3>
- <div>
- Model to shadow camera space, to compute location and depth in shadow map. Computed internally during rendering.
- </div>
- <h3>[property:WebGLRenderTarget shadowMap]</h3>
- <div>
- The depth map generated using the shadowCamera; a location beyond a pixel's depth is in shadow. Computed internally during rendering.
- </div>
- <h2>Methods</h2>
- <h3>[method:DirectionalLight clone]()</h3>
- <div>
- It returns a clone of DirectionalLight.
- </div>
- <h3>[method:JSON toJSON]()</h3>
- <div>
- Return DirectionalLight data in JSON format.
- </div>
- <h2>Source</h2>
- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
- </body>
- </html>
|