|
@@ -1,4 +1,4 @@
|
|
|
-<!DOCTYPE html>
|
|
|
+ <!DOCTYPE html>
|
|
|
<html lang="en">
|
|
|
<head>
|
|
|
<meta charset="utf-8" />
|
|
@@ -23,7 +23,7 @@
|
|
|
<a target="THREE_Examples" href="../examples/#webgl_lights_spotlight">View in Examples</a><br />
|
|
|
<h2>Other Examples</h2>
|
|
|
|
|
|
- <div>[example:webgl_lights_spotlights lights / spotlights ]</div><br />
|
|
|
+ <div>[example:webgl_lights_spotlights lights / spotlights ]</div>
|
|
|
<div>[example:webgl_interactive_cubes_gpu interactive / cubes / gpu ]</div>
|
|
|
<div>[example:webgl_interactive_draggablecubes interactive / draggablecubes ]</div>
|
|
|
<div>[example:webgl_materials_bumpmap_skin materials / bumpmap / skin ]</div>
|
|
@@ -40,12 +40,12 @@
|
|
|
|
|
|
spotLight.castShadow = true;
|
|
|
|
|
|
- spotLight.shadowMapWidth = 1024;
|
|
|
- spotLight.shadowMapHeight = 1024;
|
|
|
+ spotLight.shadow.mapSize.width = 1024;
|
|
|
+ spotLight.shadow.mapSize.height = 1024;
|
|
|
|
|
|
- spotLight.shadowCameraNear = 500;
|
|
|
- spotLight.shadowCameraFar = 4000;
|
|
|
- spotLight.shadowCameraFov = 30;
|
|
|
+ spotLight.shadow.camera.near = 500;
|
|
|
+ spotLight.shadow.camera.far = 4000;
|
|
|
+ spotLight.shadow.camera.fov = 30;
|
|
|
|
|
|
scene.add( spotLight );
|
|
|
</code>
|
|
@@ -63,9 +63,9 @@
|
|
|
<h2>Constructor</h2>
|
|
|
|
|
|
|
|
|
- <h3>[name]([page:Integer hex], [page:Float intensity], [page:Float distance], [page:Radians angle], [page:Float penumbra], [page:Float decay])</h3>
|
|
|
+ <h3>[name]( [page:Integer color], [page:Float intensity], [page:Float distance], [page:Radians angle], [page:Float penumbra], [page:Float decay] )</h3>
|
|
|
<div>
|
|
|
- [page:Integer hex] — Numeric value of the RGB component of the color. <br />
|
|
|
+ [page:Integer color] — Numeric value of the RGB component of the color. <br />
|
|
|
[page:Float intensity] — Numeric value of the light's strength/intensity. <br />
|
|
|
[page:Float distance] -- Maximum distance from origin where light will shine whose intensity is attenuated linearly based on distance from origin. <br />
|
|
|
[page:Radians angle] -- Maximum angle of light dispersion from its direction whose upper bound is Math.PI/2.<br />
|
|
@@ -75,6 +75,8 @@
|
|
|
|
|
|
<h2>Properties</h2>
|
|
|
|
|
|
+ See the base [page:Light Light] class for common properties.
|
|
|
+
|
|
|
<h3>[property:Object3D target]</h3>
|
|
|
<div>
|
|
|
Spotlight focus points at target.position.<br />
|
|
@@ -82,13 +84,6 @@
|
|
|
*Note*: Currently for target property to work properly, it must be part of the [page:Scene scene], e.g. this will help: <code>scene.add( light.target )</code>
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Float intensity]</h3>
|
|
|
- <div>
|
|
|
- Light's intensity.<br />
|
|
|
- In "physically correct" mode, the product of color * intensity is interpreted as luminous intensity measured in candela.<br/>
|
|
|
- Default — *1.0*.
|
|
|
- </div>
|
|
|
-
|
|
|
<h3>[property:Float power]</h3>
|
|
|
<div>
|
|
|
Light's power.<br />
|
|
@@ -121,86 +116,26 @@
|
|
|
Default — *1*.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Boolean castShadow]</h3>
|
|
|
+ <h3>[property:SpotLightShadow shadow]</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*.
|
|
|
+ This property stores all relevant information for rendering the shadow of the light.<br />
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Float shadowCameraNear]</h3>
|
|
|
- <div>
|
|
|
- Perspective shadow camera frustum <em>near</em> parameter.<br />
|
|
|
- Default — *50*.
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[property:Float shadowCameraFar]</h3>
|
|
|
- <div>
|
|
|
- Perspective shadow camera frustum <em>far</em> parameter.<br />
|
|
|
- Default — *5000*.
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[property:Float shadowCameraFov]</h3>
|
|
|
- <div>
|
|
|
- Perspective shadow camera frustum <em>field of view</em> parameter.<br />
|
|
|
- Default — *50*.
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[property:Boolean shadowCameraVisible]</h3>
|
|
|
+ <h3>[property:Boolean castShadow]</h3>
|
|
|
<div>
|
|
|
- Show debug shadow camera frustum.<br />
|
|
|
+ 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 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:PerspectiveCamera 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>
|
|
|
+ <h2>Methods</h2>
|
|
|
|
|
|
- <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>
|
|
|
+ See the base [page:Light Light] class for common methods.
|
|
|
|
|
|
- <h2>Methods</h2>
|
|
|
- <h3>[method:SpotLight clone]()</h3>
|
|
|
+ <h3>[method:SpotLight copy]( [page:SpotLight source] )</h3>
|
|
|
<div>
|
|
|
<br />
|
|
|
- It returns a clone of SpotLight.
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[method:JSON toJSON]()</h3>
|
|
|
- <div>
|
|
|
- Return SpotLight data in JSON format.
|
|
|
+ Copies value of *source* to this SpotLight object.
|
|
|
</div>
|
|
|
- <h2>Source</h2>
|
|
|
|
|
|
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
|
|
|
</body>
|