Browse Source

Improved documentation for GLState constants (#9982)

* updated webglrenderer docs to reference GLState constants

* Improved doc / Contants / GLState
Lewy Blue 8 years ago
parent
commit
916a1b6610
2 changed files with 35 additions and 15 deletions
  1. 31 11
      docs/api/constants/GLState.html
  2. 4 4
      docs/api/renderers/WebGLRenderer.html

+ 31 - 11
docs/api/constants/GLState.html

@@ -9,21 +9,41 @@
 	</head>
 	</head>
 	<body>
 	<body>
 		<h1>GL State Constants</h1>
 		<h1>GL State Constants</h1>
+		These are used by the WebGLRenderer to set gl.cullFace and gl.frontFace states in the GPU.
 
 
-		<h2>Cull Face</h2>
-		<div>
-		THREE.CullFaceNone<br />
-		THREE.CullFaceBack<br />
-		THREE.CullFaceFront<br />
+		<h2>Cull Face Modes</h2>
+		<code>
+		THREE.CullFaceNone
+		</code>
+		<p>Disable face culling.</p>
+		<code>
+		THREE.CullFaceBack
+		</code>
+		<p>Cull back faces (default).</p>
+		<code>
+		THREE.CullFaceFront
+		</code>
+		<p>Cull front faces.</p>
+		<code>
 		THREE.CullFaceFrontBack
 		THREE.CullFaceFrontBack
-		</div>
+		</code>
+		<p>Cull both front and back faces.</p>
 
 
 		<h2>Front Face Direction</h2>
 		<h2>Front Face Direction</h2>
-		<div>
-		THREE.FrontFaceDirectionCW<br />
-		THREE.FrontFaceDirectionCCW<br />
-		</div>
-	
+		Set the winding order for polygons to either clockwise or counter-clockwise (default).
+		<code>
+		THREE.FrontFaceDirectionCW
+		THREE.FrontFaceDirectionCCW
+		</code>
+
+		<h2>Usage</h2>
+
+		<code>
+		var renderer = new THREE.WebGLRenderer();
+
+		renderer.setFaceCulling ( THREE.CullFaceBack, THREE.FrontFaceDirectionCCW );  //defaults
+		</code>
+
 		<h2>Source</h2>
 		<h2>Source</h2>
 
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
 		[link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]

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

@@ -240,11 +240,11 @@
 
 
 		<h3>[method:null setFaceCulling]( cullFace, frontFace )</h3>
 		<h3>[method:null setFaceCulling]( cullFace, frontFace )</h3>
 		<div>
 		<div>
-		[page:String cullFace] —- "back", "front", "front_and_back", or false.<br />
-		[page:String frontFace] —- "ccw" or "cw<br />
+		See [page:GLState GLState constants] for all possible values for [page:String cullFace] and [page:String frontFace].<br />
+		Used for setting the gl.frontFace and gl.cullFace states in the GPU, thus enabling/disabling face culling when rendering.<br />
+		If cullFace is set to THREE.[page:String CullFaceNone], culling will be disabled.<br />
 		</div>
 		</div>
-		<div>Used for setting the gl frontFace, cullFace states in the GPU, thus enabling/disabling face culling when rendering.</div>
-		<div>If cullFace is false, culling will be disabled.</div>
+
 
 
 
 
 		<h3>[method:null setTexture]( [page:Texture texture], [page:number slot] )</h3>
 		<h3>[method:null setTexture]( [page:Texture texture], [page:number slot] )</h3>