Răsfoiți Sursa

Created docs for MeshPhysicalMaterial and ShadowMaterial (#10044)

* Added MeshPhysicalMaterial doc

* Added ShadowMaterial doc

* Added ranges and reflectivity details
Lewy Blue 8 ani în urmă
părinte
comite
2337142734

+ 71 - 0
docs/api/materials/MeshPhysicalMaterial.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:Material] &rarr; [page:MeshStandardMaterial] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">An extension of the [page:MeshStandardMaterial] that allows for greater control over reflectivity.</div>
+
+		<!-- <iframe id="scene" src="scenes/material-browser.html#MeshStandardMaterial"></iframe>
+
+		<script>
+
+		// iOS iframe auto-resize workaround
+
+		if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+			var scene = document.getElementById( 'scene' );
+
+			scene.style.width = getComputedStyle( scene ).width;
+			scene.style.height = getComputedStyle( scene ).height;
+			scene.setAttribute( 'scrolling', 'no' );
+
+		}
+
+		</script> -->
+
+		<h2>Examples</h2>
+		[example:webgl_materials_variations_physical materials / variations / physical]<br />
+		[example:webgl_materials_reflectivity materials / reflectivity]
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( [page:Object parameters] )</h3>
+		<div>
+		parameters -- see [page:MeshStandardMaterial]
+		</div>
+
+
+		<h2>Properties</h2>
+		<div>See the base [page:Material] and [page:MeshStandardMaterial] classes for common properties.</div>
+
+		<h3>[property:Float reflectivity]</h3>
+		<div>
+		Degree of reflectivity, from *0.0* to *1.0*. Default is *0.5*.<br />
+			
+		This models the reflectivity of non-metallic materials. It has no effect when [page:MeshStandardMaterial.metalness metalness] is *1.0*
+		</div>
+
+		<h3>[property:Float clearCoat]</h3>
+		<div>
+		ClearCoat level, from *0.0* to *1.0*. Default is *0.0*.
+		</div>
+
+		<h3>[property:Float clearCoatRoughness]</h3>
+		<div>
+		How rough the clearCoat appears, from *0.0* to *1.0*. Default is *0.0*.
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 56 - 0
docs/api/materials/ShadowMaterial.html

@@ -0,0 +1,56 @@
+<!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:Material] &rarr; [page:ShaderMaterial] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">
+		This material can recieve shadows, but otherwise is completely transparent.
+		</div>
+
+		<h3>Example</h3>
+		[example:webgl_geometry_spline_editor gemoetry / spline / editor]
+
+		<code>
+var planeGeometry = new THREE.PlaneGeometry( 2000, 2000 );
+planeGeometry.rotateX( - Math.PI / 2 );
+
+var planeMaterial = new THREE.ShadowMaterial();
+planeMaterial.opacity = 0.2;
+
+var plane = new THREE.Mesh( planeGeometry, planeMaterial );
+plane.position.y = -200;
+plane.receiveShadow = true;
+scene.add( plane );
+		</code>
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( )</h3>
+
+
+		<h2>Properties</h2>
+		<div>See the base [page:Material] and [page:ShaderMaterial] classes for common properties.</div>
+
+		<h3>[property:Boolean lights]</h3>
+		<div>Whether the material is affected by lights. Default is *true*.</div>
+
+		<h3>[property:Boolean transparent]</h3>
+		<div>Defines whether this material is transparent. Default is *true*.</div>
+
+		<h2>Methods</h2>
+		<div>See the base [page:Material] and [page:ShaderMaterial] classes for common methods.</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 2 - 0
docs/list.js

@@ -125,10 +125,12 @@ var list = {
 			[ "MeshLambertMaterial", "api/materials/MeshLambertMaterial" ],
 			[ "MeshNormalMaterial", "api/materials/MeshNormalMaterial" ],
 			[ "MeshPhongMaterial", "api/materials/MeshPhongMaterial" ],
+			[ "MeshPhysicalMaterial", "api/materials/MeshPhysicalMaterial" ],
 			[ "MeshStandardMaterial", "api/materials/MeshStandardMaterial" ],
 			[ "PointsMaterial", "api/materials/PointsMaterial" ],
 			[ "RawShaderMaterial", "api/materials/RawShaderMaterial" ],
 			[ "ShaderMaterial", "api/materials/ShaderMaterial" ],
+			[ "ShadowMaterial", "api/materials/ShadowMaterial" ],
 			[ "SpriteMaterial", "api/materials/SpriteMaterial" ]
 		],