Ver Fonte

Documentation: Updated Light Docs

Michael Herzog há 9 anos atrás
pai
commit
aca8c97047

+ 6 - 21
docs/api/lights/AmbientLight.html

@@ -30,37 +30,22 @@ scene.add( light );</code>
 
 		<h2>Constructor</h2>
 
-
-		<h3>[name]( [page:Integer hex] )</h3>
+		<h3>[name]( [page:Integer color], [page:Float intensity] )</h3>
 		<div>
-		[page:Integer hex] — Numeric value of the RGB component of the color.
+		[page:Integer color] — Numeric value of the RGB component of the color. <br />
+		[page:Float intensity] -- Numeric value of the light's strength/intensity.
 		</div>
 		<div>
-		This creates an Ambientlight with a color.
+		This creates an Ambientlight with a color and intensity.
 		</div>
 
 		<h2>Properties</h2>
 
-		<h3>[property:Float intensity]</h3>
-		<div>
-			Light's intensity.<br />
-			In "physically correct" mode, the product of color * intensity is interpreted as luminous irradiance measured in lux at the material surface.<br/>
-			Default — *1.0*.
-		</div>
-
+		See the base [page:Light Light] class for common properties.
 
 		<h2>Methods</h2>
 
-		<h3>[method:AmbientLight clone]()</h3>
-		<div>
-		<br />
-		It returns a clone of Ambientlight.
-		</div>
-
-		<h3>[method:JSON toJSON]()</h3>
-		<div>
-		Return Ambientlight data in JSON format.
-		</div>
+		See the base [page:Light Light] class for common methods.
 
 		<h2>Source</h2>
 

+ 11 - 93
docs/api/lights/DirectionalLight.html

@@ -37,8 +37,7 @@ scene.add( directionalLight );</code>
 
 		<h2>Constructor</h2>
 
-
-		<h3>[name]([page:Integer hex], [page:Float intensity])</h3>
+		<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.
@@ -52,113 +51,32 @@ scene.add( directionalLight );</code>
 
 		<h2>Properties</h2>
 
+		See the base [page:Light Light] class for common properties.
+
 		<h3>[property:Object3D target]</h3>
 		<div>
 			Target used for shadow camera orientation.
 		</div>
 
-		<h3>[property:Float intensity]</h3>
+		<h3>[property:DirectionalLightShadow shadow]</h3>
 		<div>
-			Light's intensity.<br />
-			In "physically correct" mode, the product of intensity * color is interpreted as luminous irradiance measured in lux at the material's surface.<br/>
-			Default — *1.0*.
+			This property stores all relevant information for rendering the shadow of the light.<br />
 		</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 />
+			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: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>
+		See the base [page:Light Light] class for common methods.
+
+		<h3>[method:DirectionalLight copy]( [page:DirectionalLight source] )</h3>
 		<div>
-		Return DirectionalLight data in JSON format.
+		<br />
+		Copies value of *source* to this DirectionalLight object.
 		</div>
 
 		<h2>Source</h2>

+ 33 - 0
docs/api/lights/DirectionalLightShadow.html

@@ -0,0 +1,33 @@
+<!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:LightShadow] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">TODO</div>
+
+		<h2>Constructor</h2>
+
+		The constructor creates an [page:OrthographicCamera OrthographicCamera] to manage the shadow's view of the world.
+
+		<h2>Properties</h2>
+
+		See the base [page:LightShadow LightShadow] class for common properties.
+
+		<h2>Methods</h2>
+
+		See the base [page:LightShadow LightShadow] class for common methods.
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 9 - 16
docs/api/lights/HemisphereLight.html

@@ -29,39 +29,32 @@ scene.add( light );</code>
 		<h2>Constructor</h2>
 
 
-		<h3>[name]([page:Integer skyColorHex], [page:Integer groundColorHex], [page:Float intensity])</h3>
+		<h3>[name]( [page:Integer skyColor], [page:Integer groundColor], [page:Float intensity] )</h3>
         <div>
-		[page:Integer skyColorHex] — Numeric value of the RGB sky color.<br />
-		[page:Integer groundColorHex] — Numeric value of the RGB ground color.<br />
+		[page:Integer skyColor] — Numeric value of the RGB sky color.<br />
+		[page:Integer groundColor] — Numeric value of the RGB ground color.<br />
 		[page:Float intensity] — Numeric value of the light's strength/intensity.
 		</div>
 
 		<h2>Properties</h2>
 
+		See the base [page:Light Light] class for common properties.
+
 		<h3>[property:Float groundColor]</h3>
 
 		<div>
 			Light's ground color.<br />
 		</div>
 
-		<h3>[property:Float intensity]</h3>
-		<div>
-			Light's intensity.<br />
-			In "physically correct" mode, the product of intensity * color (or intensity * groundColor) is interpreted as luminous irradiance measured in lux at the material's surface.<br/>
-			Default — *1.0*.
-		</div>
 
 		<h2>Methods</h2>
 
-		<h3>[method:HemisphereLight clone]()</h3>
-		<div>
-		<br />
-		It returns a clone of HemisphereLight.
-		</div>
+		See the base [page:Light Light] class for common methods.
 
-		<h3>[method:JSON toJSON]()</h3>
+		<h3>[method:HemisphereLight copy]( [page:HemisphereLight source] )</h3>
 		<div>
-		Return HemisphereLight data in JSON format.
+		<br />
+		Copies value of *source* to this HemisphereLight object.
 		</div>
 
 		<h2>Source</h2>

+ 26 - 10
docs/api/lights/Light.html

@@ -18,30 +18,46 @@
 		<h2>Constructor</h2>
 
 
-		<h3>[name]( [page:Integer hex] )</h3>
+		<h3>[name]( [page:Integer color], [page:float intensity] )</h3>
 		<div>
-		[page:Integer hex] — Numeric value of the RGB component of the color.
+		[page:Integer color] — Numeric value of the RGB component of the color.<br />
+		[page:Float intensity] — Numeric value of the light's strength/intensity.
 		</div>
 		<div>
-		This creates a light with color.<br />
+		This creates a light with color and intensity.<br />
 		</div>
 
-
 		<h2>Properties</h2>
 
+		See the base [page:Object3D Object3D] class for common properties.
+
 		<h3>[property:Color color]</h3>
 		<div>
-		Color of the light.<br />
+			Color of the light.<br />
+		</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>
-		
+
 		<h2>Methods</h2>
-		
-		<h3>[method:Light clone]()</h3>
+
+		See the base [page:Object3D Object3D] class for common methods.
+
+		<h3>[method:Light copy]( [page:Light source] )</h3>
 		<div>
 		<br />
-		It returns a clone of Light.
+		Copies value of *source* to this Light object.
+		</div>
+
+		<h3>[method:JSON toJSON]( [page:String meta] )</h3>
+		<div>
+		Return Light data in JSON format.
 		</div>
-		
+
 		<h2>Source</h2>
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

+ 75 - 0
docs/api/lights/LightShadow.html

@@ -0,0 +1,75 @@
+<!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>
+
+		<h1>[name]</h1>
+
+		<div class="desc">TODO</div>
+
+		<h2>Constructor</h2>
+
+
+		<h3>[name]( [page:Camera camera] )</h3>
+		<div>
+		[page:Camera camera] — The shadow's view of the world.
+		</div>
+
+		<h2>Properties</h2>
+
+		<h3>[property:Camera camera]</h3>
+		<div>
+			The shadow's view of the world.
+		</div>
+
+		<h3>[property:Float bias]</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:Float radius]</h3>
+		<div>
+			TODO<br />
+			Default - *0*.
+		</div>
+
+		<h3>[property:Vector2 mapSize]</h3>
+		<div>
+			The width and height of the shadow map stored in a [page:Vector2 Vector2].<br />
+			Default — *( 512, 512 )*.
+		</div>
+
+		<h3>[property:WebGLRenderTarget map]</h3>
+		<div>
+			The depth map generated using the internal camera; a location beyond a pixel's depth is in shadow. Computed internally during rendering.
+		</div>
+
+		<h3>[property:Matrix4 matrix]</h3>
+		<div>
+			Model to shadow camera space, to compute location and depth in shadow map. Stored in a [page:Matrix4 Matrix4]. Computed internally during rendering.
+		</div>
+
+
+		<h2>Methods</h2>
+		<h3>[method:LightShadow copy]( [page:LightShadow source] )</h3>
+		<div>
+		Copies value of *source* to this LightShadow object.
+		</div>
+
+		<h3>[method:LightShadow clone]()</h3>
+		<div>
+		It returns a clone of LightShadow.
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 12 - 17
docs/api/lights/PointLight.html

@@ -37,9 +37,9 @@ scene.add( light );</code>
 		<h2>Constructor</h2>
 
 
-		<h3>[name]([page:Integer hex], [page:Float intensity], [page:Number distance], [page:Float decay])</h3>
+		<h3>[name]( [page:Integer color], [page:Float intensity], [page:Number distance], [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:Number distance] -- The distance of the light where the intensity is 0. When distance is 0, then the distance is endless. <br />
 		[page:Float decay] -- The amount the light dims along the distance of the light.
@@ -49,15 +49,9 @@ scene.add( light );</code>
 
 		</div>
 
-
 		<h2>Properties</h2>
 
-		<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>
+		See the base [page:Light Light] class for common properties.
 
 		<h3>[property:Float power]</h3>
 		<div>
@@ -79,20 +73,21 @@ scene.add( light );</code>
 			Default — *1*.
 		</div>
 
-		<h2>Methods</h2>
-
-		<h3>[method:PointLight clone]()</h3>
+		<h3>[property:LightShadow shadow]</h3>
 		<div>
-		<br />
-		It returns a clone of PointLight.
+			This property stores all relevant information for rendering the shadow of the light.<br />
 		</div>
 
-		<h3>[method:JSON toJSON]()</h3>
+		<h2>Methods</h2>
+
+		See the base [page:Light Light] class for common methods.
+
+		<h3>[method:PointLight copy]( [page:PointLight source] )</h3>
 		<div>
-		Return PointLight data in JSON format.
+		<br />
+		Copies value of *source* to this PointLight object.
 		</div>
 
-
 		<h2>Source</h2>
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

+ 19 - 84
docs/api/lights/SpotLight.html

@@ -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>

+ 38 - 0
docs/api/lights/SpotLightShadow.html

@@ -0,0 +1,38 @@
+<!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:LightShadow] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">TODO</div>
+
+		<h2>Constructor</h2>
+
+		The constructor creates a [page:PerspectiveCamera PerspectiveCamera] to manage the shadow's view of the world.
+
+		<h2>Properties</h2>
+
+		See the base [page:LightShadow LightShadow] class for common properties.
+
+		<h2>Methods</h2>
+
+		See the base [page:LightShadow LightShadow] class for common methods.
+
+		<h3>[method:SpotLightShadow update]( [page:SpotLight light] )</h3>
+		<div>
+		Updates the internal perspective camera.
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 4 - 1
docs/list.js

@@ -37,10 +37,13 @@ var list = {
 		"Lights": [
 			[ "AmbientLight", "api/lights/AmbientLight" ],
 			[ "DirectionalLight", "api/lights/DirectionalLight" ],
+			[ "DirectionalLightShadow", "api/lights/DirectionalLightShadow" ],
 			[ "HemisphereLight", "api/lights/HemisphereLight" ],
 			[ "Light", "api/lights/Light" ],
+			[ "LightShadow", "api/lights/LightShadow" ],
 			[ "PointLight", "api/lights/PointLight" ],
-			[ "SpotLight", "api/lights/SpotLight" ]
+			[ "SpotLight", "api/lights/SpotLight" ],
+			[ "SpotLightShadow", "api/lights/SpotLightShadow" ]
 		],