Browse Source

Merge pull request #19372 from Mugen87/dev45

Docs: Add page for LightProbe and LightProbeGenerator.
Mr.doob 5 years ago
parent
commit
7f87f76bc4

+ 71 - 0
docs/api/en/lights/LightProbe.html

@@ -0,0 +1,71 @@
+<!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] &rarr; [page:Light] &rarr;
+
+		<h1>[name]</h1>
+
+		<p class="desc">
+			Light probes are an alternative way of adding light to a 3D scene. Unlike classical light sources (e.g. directional,
+			point or spot lights), light probes do not emit light. Instead they store information about light passing through
+			3D space. During rendering, the light that hits a 3D object is approximated by using the data from the light probe.
+		</p>
+
+		<p class="desc">
+			Light probes are usually created from (radiance) environment maps. The class [page:LightProbeGenerator] can
+			be used to create light probes from instances of [page:CubeTexture] or [page:WebGLCubeRenderTarget].
+			However, light estimation data could also be provided in other forms e.g. by WebXR. This enables the rendering
+			of augmented reality content that reacts to real world lighting.
+		</p>
+
+		<p class="desc">
+			The current probe implementation in three.js only supports so called diffuse light probes. This type of light probe
+			is a different representation of an irradiance environment map. Other types of light probes like reflection probes
+			are not yet supported.
+		</p>
+
+		<h2>Examples</h2>
+		<p>
+			[example:webgl_lightprobe WebGL / light probe ]<br />
+			[example:webgl_lightprobe_cubecamera WebGL / light probe / cube camera ]
+		</p>
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( [param:SphericalHarmonics3 sh], [param:Float intensity] )</h3>
+		<p>
+		[page:SphericalHarmonics3 sh] - (optional) An instance of [page:SphericalHarmonics3].<br />
+		[page:Float intensity] - (optional) Numeric value of the light probe's intensity. Default is 1.<br /><br />
+
+		Creates a new [name].
+		</p>
+
+		<h2>Properties</h2>
+		<p>
+				See the base [page:Light Light] class for common properties. The [page:Light.color color] property is currently
+				not evaluated and thus has no effect.
+		</p>
+
+		<h3>[property:SphericalHarmonics3 sh]</h3>
+		<p>
+			A light probe uses spherical harmonics to encode lighting information.
+		</p>
+
+		<h2>Methods</h2>
+		<p>
+				See the base [page:Light Light] class for common methods.
+		</p>
+		<h2>Source</h2>
+
+		<p>
+			[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+		</p>
+	</body>
+</html>

+ 0 - 0
docs/api/en/math/SphericalHarmonics.html → docs/api/en/math/SphericalHarmonics3.html


+ 71 - 0
docs/api/zh/lights/LightProbe.html

@@ -0,0 +1,71 @@
+<!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] &rarr; [page:Light] &rarr;
+
+		<h1>[name]</h1>
+
+		<p class="desc">
+			Light probes are an alternative way of adding light to a 3D scene. Unlike classical light sources (e.g. directional,
+			point or spot lights), light probes do not emit light. Instead they store information about light passing through
+			3D space. During rendering, the light that hits a 3D object is approximated by using the data from the light probe.
+		</p>
+
+		<p class="desc">
+			Light probes are usually created from (radiance) environment maps. The class [page:LightProbeGenerator] can
+			be used to create light probes from instances of [page:CubeTexture] or [page:WebGLCubeRenderTarget].
+			However, light estimation data could also be provided in other forms e.g. by WebXR. This enables the rendering
+			of augmented reality content that reacts to real world lighting.
+		</p>
+
+		<p class="desc">
+			The current probe implementation in three.js only supports so called diffuse light probes. This type of light probe
+			is a different representation of an irradiance environment map. Other types of light probes like reflection probes
+			are not yet supported.
+		</p>
+
+		<h2>Examples</h2>
+		<p>
+			[example:webgl_lightprobe WebGL / light probe ]<br />
+			[example:webgl_lightprobe_cubecamera WebGL / light probe / cube camera ]
+		</p>
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( [param:SphericalHarmonics3 sh], [param:Float intensity] )</h3>
+		<p>
+		[page:SphericalHarmonics3 sh] - (optional) An instance of [page:SphericalHarmonics3].<br />
+		[page:Float intensity] - (optional) Numeric value of the light probe's intensity. Default is 1.<br /><br />
+
+		Creates a new [name].
+		</p>
+
+		<h2>Properties</h2>
+		<p>
+				See the base [page:Light Light] class for common properties. The [page:Light.color color] property is currently
+				not evaluated and thus has no effect.
+		</p>
+
+		<h3>[property:SphericalHarmonics3 sh]</h3>
+		<p>
+			A light probe uses spherical harmonics to encode lighting information.
+		</p>
+
+		<h2>Methods</h2>
+		<p>
+				See the base [page:Light Light] class for common methods.
+		</p>
+		<h2>Source</h2>
+
+		<p>
+			[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+		</p>
+	</body>
+</html>

+ 0 - 0
docs/api/zh/math/SphericalHarmonics.html → docs/api/zh/math/SphericalHarmonics3.html


+ 46 - 0
docs/examples/en/lights/LightProbeGenerator.html

@@ -0,0 +1,46 @@
+<!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>
+
+		<p class="desc">
+			Utility class for creating instances of [page:LightProbe].
+		</p>
+
+		<h2>Examples</h2>
+
+		<p>
+			[example:webgl_lightprobe WebGL / light probe ]<br />
+			[example:webgl_lightprobe_cubecamera WebGL / light probe / cube camera ]
+		</p>
+
+		<h2>Static Methods</h2>
+
+		<h3>[method:LightProbe fromCubeTexture] ( [param:CubeTexture cubeTexture] )</h3>
+		<p>
+			Creates a light probe from the given (radiance) environment map. The method expects that the environment map is represented as a cube texture.
+		</p>
+
+		<h3>[method:LightProbe fromCubeRenderTarget] ( [param:WebGLRenderer renderer], [param:WebGLCubeRenderTarget cubeRenderTarget] )</h3>
+		<p>
+			Creates a light probe from the given (radiance) environment map. The method expects that the environment map is represented as a cube render target.
+		</p>
+		<p>
+			The [page:Texture.format format] of the cube render target must be set to *RGBA*.
+		</p>
+
+		<h2>Source</h2>
+
+		<p>
+			[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/lights/LightProbeGenerator.js examples/jsm/lights/LightProbeGenerator.js]
+		</p>
+	</body>
+</html>

+ 46 - 0
docs/examples/zh/lights/LightProbeGenerator.html

@@ -0,0 +1,46 @@
+<!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>
+
+		<p class="desc">
+			Utility class for creating instances of [page:LightProbe].
+		</p>
+
+		<h2>Examples</h2>
+
+		<p>
+			[example:webgl_lightprobe WebGL / light probe ]<br />
+			[example:webgl_lightprobe_cubecamera WebGL / light probe / cube camera ]
+		</p>
+
+		<h2>Static Methods</h2>
+
+		<h3>[method:LightProbe fromCubeTexture] ( [param:CubeTexture cubeTexture] )</h3>
+		<p>
+			Creates a light probe from the given (radiance) environment map. The method expects that the environment map is represented as a cube texture.
+		</p>
+
+		<h3>[method:LightProbe fromCubeRenderTarget] ( [param:WebGLRenderer renderer], [param:WebGLCubeRenderTarget cubeRenderTarget] )</h3>
+		<p>
+			Creates a light probe from the given (radiance) environment map. The method expects that the environment map is represented as a cube render target.
+		</p>
+		<p>
+			The [page:Texture.format format] of the cube render target must be set to *RGBA*.
+		</p>
+
+		<h2>Source</h2>
+
+		<p>
+			[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/lights/LightProbeGenerator.js examples/jsm/lights/LightProbeGenerator.js]
+		</p>
+	</body>
+</html>

+ 12 - 2
docs/list.js

@@ -205,6 +205,7 @@ var list = {
 				"DirectionalLight": "api/en/lights/DirectionalLight",
 				"DirectionalLight": "api/en/lights/DirectionalLight",
 				"HemisphereLight": "api/en/lights/HemisphereLight",
 				"HemisphereLight": "api/en/lights/HemisphereLight",
 				"Light": "api/en/lights/Light",
 				"Light": "api/en/lights/Light",
+				"LightProbe": "api/en/lights/LightProbe",
 				"PointLight": "api/en/lights/PointLight",
 				"PointLight": "api/en/lights/PointLight",
 				"RectAreaLight": "api/en/lights/RectAreaLight",
 				"RectAreaLight": "api/en/lights/RectAreaLight",
 				"SpotLight": "api/en/lights/SpotLight"
 				"SpotLight": "api/en/lights/SpotLight"
@@ -279,7 +280,7 @@ var list = {
 				"Ray": "api/en/math/Ray",
 				"Ray": "api/en/math/Ray",
 				"Sphere": "api/en/math/Sphere",
 				"Sphere": "api/en/math/Sphere",
 				"Spherical": "api/en/math/Spherical",
 				"Spherical": "api/en/math/Spherical",
-				"SphericalHarmonics": "api/en/math/SphericalHarmonics",
+				"SphericalHarmonics3": "api/en/math/SphericalHarmonics3",
 				"Triangle": "api/en/math/Triangle",
 				"Triangle": "api/en/math/Triangle",
 				"Vector2": "api/en/math/Vector2",
 				"Vector2": "api/en/math/Vector2",
 				"Vector3": "api/en/math/Vector3",
 				"Vector3": "api/en/math/Vector3",
@@ -379,6 +380,10 @@ var list = {
 				"VertexTangentsHelper": "examples/en/helpers/VertexTangentsHelper"
 				"VertexTangentsHelper": "examples/en/helpers/VertexTangentsHelper"
 			},
 			},
 
 
+			"Lights": {
+				"LightProbeGenerator": "examples/en/lights/LightProbeGenerator"
+			},
+
 			"Loaders": {
 			"Loaders": {
 				"BasisTextureLoader": "examples/en/loaders/BasisTextureLoader",
 				"BasisTextureLoader": "examples/en/loaders/BasisTextureLoader",
 				"DRACOLoader": "examples/en/loaders/DRACOLoader",
 				"DRACOLoader": "examples/en/loaders/DRACOLoader",
@@ -658,6 +663,7 @@ var list = {
 				"DirectionalLight": "api/zh/lights/DirectionalLight",
 				"DirectionalLight": "api/zh/lights/DirectionalLight",
 				"HemisphereLight": "api/zh/lights/HemisphereLight",
 				"HemisphereLight": "api/zh/lights/HemisphereLight",
 				"Light": "api/zh/lights/Light",
 				"Light": "api/zh/lights/Light",
+				"LightProbe": "api/zh/lights/LightProbe",
 				"PointLight": "api/zh/lights/PointLight",
 				"PointLight": "api/zh/lights/PointLight",
 				"RectAreaLight": "api/zh/lights/RectAreaLight",
 				"RectAreaLight": "api/zh/lights/RectAreaLight",
 				"SpotLight": "api/zh/lights/SpotLight"
 				"SpotLight": "api/zh/lights/SpotLight"
@@ -732,7 +738,7 @@ var list = {
 				"Ray": "api/zh/math/Ray",
 				"Ray": "api/zh/math/Ray",
 				"Sphere": "api/zh/math/Sphere",
 				"Sphere": "api/zh/math/Sphere",
 				"Spherical": "api/zh/math/Spherical",
 				"Spherical": "api/zh/math/Spherical",
-				"SphericalHarmonics": "api/zh/math/SphericalHarmonics",
+				"SphericalHarmonics3": "api/zh/math/SphericalHarmonics3",
 				"Triangle": "api/zh/math/Triangle",
 				"Triangle": "api/zh/math/Triangle",
 				"Vector2": "api/zh/math/Vector2",
 				"Vector2": "api/zh/math/Vector2",
 				"Vector3": "api/zh/math/Vector3",
 				"Vector3": "api/zh/math/Vector3",
@@ -823,6 +829,10 @@ var list = {
 				"DecalGeometry": "examples/zh/geometries/DecalGeometry"
 				"DecalGeometry": "examples/zh/geometries/DecalGeometry"
 			},
 			},
 
 
+			"灯光": {
+				"LightProbeGenerator": "examples/zh/lights/LightProbeGenerator"
+			},
+
 			"辅助对象": {
 			"辅助对象": {
 				"FaceNormalsHelper": "examples/zh/helpers/FaceNormalsHelper",
 				"FaceNormalsHelper": "examples/zh/helpers/FaceNormalsHelper",
 				"LightProbeHelper": "examples/zh/helpers/LightProbeHelper",
 				"LightProbeHelper": "examples/zh/helpers/LightProbeHelper",