Bläddra i källkod

Improved documentation for constants / shadowingTypes (#9984)

Lewy Blue 8 år sedan
förälder
incheckning
0ca905d9c5
2 ändrade filer med 25 tillägg och 7 borttagningar
  1. 24 6
      docs/api/constants/ShadowingTypes.html
  2. 1 1
      docs/api/renderers/WebGLRenderer.html

+ 24 - 6
docs/api/constants/ShadowingTypes.html

@@ -9,14 +9,32 @@
 	</head>
 	<body>
 		<h1>Shadowing Type Constants</h1>
+		<p>These define the shadow map types used by the WebGLRenderer.</p>
 
-		<h2>Shadow Map</h2>
-		<div>
-		THREE.BasicShadowMap<br />
-		THREE.PCFShadowMap<br />
+		<h2>Shadow Map Types</h2>
+		<code>
+		THREE.BasicShadowMap
+		</code>
+		<p>Unfiltered shadow maps - fastest, but lowest quality.</p>
+		<code>
+		THREE.PCFShadowMap
+		</code>
+		<p>Shadow maps filtered using the Percentage-Closer Filtering (PCF) algorithm (default).</p>
+		<code>
 		THREE.PCFSoftShadowMap
-		</div>
-	
+		</code>
+		<p>Shadow maps filtered using the Percentage-Closer Soft Shadows (PCSS) algorithm.</p>
+
+		<h2>Usage</h2>
+		<code>
+		var renderer = new THREE.WebGLRenderer();
+		renderer.shadowMap.enabled = true;
+		renderer.shadowMap.type = THREE.PCFShadowMap; //default
+		</code>
+
+		Note that this just enables shadows in the renderer and sets the shadow map type. <br />
+		To actually cast shadows you will have to set up shadows for the any light you want to cast shadows, and for meshes you want to cast / receive shadows. <br />
+
 		<h2>Source</h2>
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]

+ 1 - 1
docs/api/renderers/WebGLRenderer.html

@@ -103,7 +103,7 @@
 		<h3>[property:Integer shadowMap.type]</h3>
 
 		<div>Defines shadow map type (unfiltered, percentage close filtering, percentage close filtering with bilinear filtering in shader)</div>
-		<div>Options are THREE.BasicShadowMap, THREE.PCFShadowMap, THREE.PCFSoftShadowMap. Default is THREE.PCFShadowMap.</div>
+		<div>Options are THREE.BasicShadowMap, THREE.PCFShadowMap (default), THREE.PCFSoftShadowMap. See [page:ShadowingTypes ShadowingTypes constants] for details.</div>
 
 		<h3>[property:Boolean shadowMap.renderReverseSided]</h3>