Browse Source

Improved documentation for constants / Materials (#9993)

Lewy Blue 8 years ago
parent
commit
1c5569ba6c
1 changed files with 58 additions and 21 deletions
  1. 58 21
      docs/api/constants/Materials.html

+ 58 - 21
docs/api/constants/Materials.html

@@ -10,45 +10,82 @@
 	<body>
 		<h1>Material Constants</h1>
 
+		<div class="desc">
+		These constants define properties common to all material types,
+		with the exception of [page:MultiMaterial MultiMaterial] where they are defined for sub-materials.
+		</div>
+
+
 		<h2>Side</h2>
-		<div>
-		THREE.FrontSide<br />
-		THREE.BackSide<br />
+		<code>
+		THREE.FrontSide
+		THREE.BackSide
 		THREE.DoubleSide
+		</code>
+		<div>
+		Defines which side of faces will be rendered - front, back or both.
+		Default is [page:Constant FrontSide].
 		</div>
 
+
 		<h2>Shading</h2>
+		<code>
+	  THREE.SmoothShading
+		THREE.FlatShading
+		</code>
 		<div>
-		THREE.FlatShading<br />
-		THREE.SmoothShading
+		[page:Constant SmoothShading] is the default and linearly interpolates color between vertices.<br />
+		[page:Constant FlatShading] uses the color of the first vertex for every pixel in a face.
 		</div>
 
 		<h2>Colors</h2>
-		<div>
-		THREE.NoColors<br />
-		THREE.FaceColors<br />
+		<code>
+		THREE.NoColors
+		THREE.FaceColors
 		THREE.VertexColors
+		</code>
+		<div>
+		[page:Constant NoColors] is the default and applies the material's color to all faces.<br />
+		[page:Constant FaceColors] colors faces according to each [page:Face3 Face3][property:Color color] value.<br />
+		[page:Constant VertexColors] colors faces according to each [page:Face3 Face3][property:Array vertexColors] value. This is an array of three [page:Color Color]s, one for each vertex in the face.<br />
+		See the [example:webgl_geometry_colors geometry / colors] example.
 		</div>
 
 		<h2>Blending Mode</h2>
-		<div>
-		THREE.NoBlending<br />
-		THREE.NormalBlending<br />
-		THREE.AdditiveBlending<br />
-		THREE.SubtractiveBlending<br />
-		THREE.MultiplyBlending<br />
+		<code>
+		THREE.NoBlending
+		THREE.NormalBlending
+		THREE.AdditiveBlending
+		THREE.SubtractiveBlending
+		THREE.MultiplyBlending
 		THREE.CustomBlending
+		</code>
+		<div>
+		These control the source and destination blending equations for the material's RGB and Alpha sent to the WebGLRenderer for use by WebGL.<br />
+		[page:Constant NormalBlending] is the default.<br />
+		Note that [page:Constant CustomBlending] must be set to use [page:CustomBlendingEquation Custom Blending Equations].<br />
+		See the [example:webgl_materials_blending materials / blending] example.<br />
 		</div>
 
 		<h2>Depth Mode</h2>
-		<div>
-		THREE.NeverDepth<br />
-		THREE.AlwaysDepth<br />
-		THREE.LessDepth<br />
-		THREE.LessEqualDepth<br />
-		THREE.GreaterEqualDepth<br />
-		THREE.GreaterDepth<br />
+		<code>
+		THREE.NeverDepth
+		THREE.AlwaysDepth
+		THREE.LessDepth
+		THREE.LessEqualDepth
+		THREE.GreaterEqualDepth
+		THREE.GreaterDepth
 		THREE.NotEqualDepth
+		</code>
+		<div>
+		Which depth function the material uses to compare incoming pixels Z-depth against the current Z-depth buffer value. If the result of the comparison is true, the pixel will be drawn.<br />
+		[page:Materials NeverDepth] will never return true.<br />
+		[page:Materials AlwaysDepth] will always return true.<br />
+		[page:Materials LessDepth] will return true if the incoming pixel Z-depth is less than the current buffer Z-depth.<br />
+		[page:Materials LessEqualDepth] is the default and will return true if the incoming pixel Z-depth is less than or equal to the current buffer Z-depth.<br />
+		[page:Materials GreaterEqualDepth] will return true if the incoming pixel Z-depth is greater than or equal to the current buffer Z-depth.<br />
+		[page:Materials GreaterDepth] will return true if the incoming pixel Z-depth is greater than the current buffer Z-depth.<br />
+		[page:Materials NotEqualDepth] will return true if the incoming pixel Z-depth is equal to the current buffer Z-depth.<br />
 		</div>
 
 		<h2>Source</h2>