提交 2163691b 编写于 作者: A alteredq

Fixed subtle yet brutal bug also known as "don't mess with streams" ;)

This one kept me puzzled for days. Premature optimization is indeed evil.

Manifestation was that MeshShaderMaterial mysteriously didn't work depending on what was going on elsewhere in the scene. I think mrdoob's problem with "basic" shader was caused by this bug.
上级 3b545059
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -536,6 +536,7 @@ THREE.WebGLRenderer = function ( scene ) {
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryChunk.__webGLVertexBuffer );
_gl.vertexAttribPointer( attributes.position, 3, _gl.FLOAT, false, 0, 0 );
_gl.enableVertexAttribArray( attributes.position );
// normals
......@@ -543,6 +544,7 @@ THREE.WebGLRenderer = function ( scene ) {
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryChunk.__webGLNormalBuffer );
_gl.vertexAttribPointer( attributes.normal, 3, _gl.FLOAT, false, 0, 0 );
_gl.enableVertexAttribArray( attributes.normal );
}
......@@ -552,7 +554,8 @@ THREE.WebGLRenderer = function ( scene ) {
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryChunk.__webGLTangentBuffer );
_gl.vertexAttribPointer( attributes.tangent, 4, _gl.FLOAT, false, 0, 0 );
_gl.enableVertexAttribArray( attributes.tangent );
}
// uvs
......@@ -560,11 +563,11 @@ THREE.WebGLRenderer = function ( scene ) {
if ( attributes.uv >= 0 ) {
if ( geometryChunk.__webGLUVBuffer ) {
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryChunk.__webGLUVBuffer );
_gl.vertexAttribPointer( attributes.uv, 2, _gl.FLOAT, false, 0, 0 );
_gl.enableVertexAttribArray( attributes.uv );
_gl.vertexAttribPointer( attributes.uv, 2, _gl.FLOAT, false, 0, 0 );
} else {
......@@ -1411,12 +1414,6 @@ THREE.WebGLRenderer = function ( scene ) {
id = identifiers[ i ];
program.attributes[ id ] = _gl.getAttribLocation( program, id );
if ( program.attributes[ id ] >= 0 ) {
_gl.enableVertexAttribArray( program.attributes[ id ] );
}
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册