提交 702dd37b 编写于 作者: A Alex Goldring

debug to literal object, and error checks disabled by default

Took 11 minutes
上级 b2790d52
......@@ -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>
......
<!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>
......@@ -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>
......
<!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>
......@@ -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
......
/**
* @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 };
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册