Explorar o código

debug to literal object, and error checks disabled by default

Took 11 minutes
Alex Goldring %!s(int64=6) %!d(string=hai) anos
pai
achega
702dd37b2c

+ 6 - 2
docs/api/en/renderers/WebGLRenderer.html

@@ -92,9 +92,13 @@
 			Default is *true*.
 		</p>
 
-		<h3>[property:WebGLRendererDebug debug]</h3>
+		<h3>[property:Boolean debug.checkShaderErrors]</h3>
 		<p>
-			Contains debug configuration of the renderer
+			If [page:.checkShaderErrors checkShaderErrors] is true, defines whether material shader programs are checked
+			for errors during compilation and linkage process. It may be useful to disable this check in production for performance gain.
+			It is strongly recommended to keep these checks enabled during development.
+			If the shader does not compile and link - it will not work and associated material will not render.
+			Default is *true*.
 		</p>
 
 		<h3>[property:Object capabilities]</h3>

+ 0 - 33
docs/api/en/renderers/WebGLRendererDebug.html

@@ -1,33 +0,0 @@
-<!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">
-			The debug configuration container for WebGLRenderer
-		</p>
-
-
-		<h2>Properties</h2>
-
-		<h3>[property:Boolean checkShaderErrors]</h3>
-		<p>
-			If [page:.checkShaderErrors checkShaderErrors] is true, defines whether material shader programs are checked
-			for errors during compilation and linkage process. It may be useful to disable this check in production for performance gain.
-			It is strongly recommended to keep these checks enabled during development.
-			If the shader does not compile and link - it will not work and associated material will not render.
-			Default is *true*.
-		</p>
-
-		<h2>Source</h2>
-
-		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
-	</body>
-</html>

+ 6 - 2
docs/api/zh/renderers/WebGLRenderer.html

@@ -79,9 +79,13 @@
 			默认是*true*
 		</p>
 
-		<h3>[property:WebGLRendererDebug debug]</h3>
+		<h3>[property:Boolean debug.checkShaderErrors]</h3>
 		<p>
-			包含渲染器的调试配置。
+			如果[page:.checkShaderErrors checkShaderErrors]为true,定义是否检查材质着色器程序
+			编译和链接过程中的错误。 禁用此检查生产以获得性能增益可能很有用。
+			强烈建议在开发期间保持启用这些检查。
+			如果着色器没有编译和链接 - 它将无法工作,并且相关材料将不会呈现。
+			默认是*true*
 		</p>
 
 		<h3>[property:Object capabilities]</h3>

+ 0 - 34
docs/api/zh/renderers/WebGLRendererDebug.html

@@ -1,34 +0,0 @@
-<!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">
-			The debug configuration container for WebGLRenderer
-		</p>
-
-
-		<h2>Properties</h2>
-
-		<h3>[property:Boolean checkShaderErrors]</h3>
-		<p>
-
-			如果[page:.checkShaderErrors checkShaderErrors]为true,定义是否检查材质着色器程序
-			编译和链接过程中的错误。 禁用此检查生产以获得性能增益可能很有用。
-			强烈建议在开发期间保持启用这些检查。
-			如果着色器没有编译和链接 - 它将无法工作,并且相关材料将不会呈现。
-			默认是*true*
-		</p>
-
-		<h2>Source</h2>
-
-		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
-	</body>
-</html>

+ 9 - 2
src/renderers/WebGLRenderer.js

@@ -36,7 +36,6 @@ import { WebGLPrograms } from './webgl/WebGLPrograms.js';
 import { WebGLProperties } from './webgl/WebGLProperties.js';
 import { WebGLRenderLists } from './webgl/WebGLRenderLists.js';
 import { WebGLRenderStates } from './webgl/WebGLRenderStates.js';
-import { WebGLRendererDebug } from "./WebGLRendererDebug.js";
 import { WebGLShadowMap } from './webgl/WebGLShadowMap.js';
 import { WebGLState } from './webgl/WebGLState.js';
 import { WebGLTextures } from './webgl/WebGLTextures.js';
@@ -78,7 +77,15 @@ function WebGLRenderer( parameters ) {
 	this.domElement = _canvas;
 	this.context = null;
 
-	this.debug = new WebGLRendererDebug();
+	// Debug configuration container
+	this.debug = {
+
+		/**
+		 * Enables error checking and reporting when shader programs are being compiled
+		 * @type {boolean}
+		 */
+		checkShaderErrors: false
+	};
 
 	// clearing
 

+ 0 - 15
src/renderers/WebGLRendererDebug.js

@@ -1,15 +0,0 @@
-/**
- * @author Alex Goldring | https://github.com/Usnul
- */
-
-function WebGLRendererDebug() {
-
-	/**
-	 * Enables error checking and reporting when shader programs are being compiled
-	 * @type {boolean}
-	 */
-	this.checkShaderErrors = true;
-
-}
-
-export { WebGLRendererDebug };