提交 b7950e02 编写于 作者: M Mr.doob

WebGLRenderer: Giving ‘position’ attribute index 0 by default. Fixes #4364.

上级 b267595d
......@@ -5700,11 +5700,17 @@ THREE.WebGLRenderer = function ( parameters ) {
_gl.attachShader( program, glVertexShader );
_gl.attachShader( program, glFragmentShader );
//Force a particular attribute to index 0.
// Force a particular attribute to index 0.
// because potentially expensive emulation is done by browser if attribute 0 is disabled.
//And, color, for example is often automatically bound to index 0 so disabling it
if ( index0AttributeName ) {
// And, color, for example is often automatically bound to index 0 so disabling it
if ( index0AttributeName !== undefined ) {
_gl.bindAttribLocation( program, 0, index0AttributeName );
} else {
_gl.bindAttribLocation( program, 0, 'position' );
}
_gl.linkProgram( program );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册