mirror of
https://github.com/wahyd4/three.js.git
synced 2026-08-09 04:56:01 +10:00
Removed bugs related to custom attributes and buffers. Removed bug related to attributes.position
This commit is contained in:
@@ -2217,8 +2217,7 @@ THREE.WebGLRenderer = function ( parameters ) {
|
||||
|
||||
var attributes = material.program.attributes;
|
||||
|
||||
_gl.enableVertexAttribArray( attributes.position );
|
||||
|
||||
if ( attributes.position >= 0 ) _gl.enableVertexAttribArray( attributes.position );
|
||||
if ( attributes.color >= 0 ) _gl.enableVertexAttribArray( attributes.color );
|
||||
if ( attributes.normal >= 0 ) _gl.enableVertexAttribArray( attributes.normal );
|
||||
if ( attributes.tangent >= 0 ) _gl.enableVertexAttribArray( attributes.tangent );
|
||||
@@ -2234,13 +2233,18 @@ THREE.WebGLRenderer = function ( parameters ) {
|
||||
|
||||
}
|
||||
|
||||
for ( a in material.attributes ) {
|
||||
|
||||
if( attributes[ a ] >= 0 ) _gl.enableVertexAttribArray( attributes[ a ] );
|
||||
|
||||
if ( material.attributes ) {
|
||||
|
||||
for ( a in material.attributes ) {
|
||||
|
||||
if( attributes[ a ] !== undefined && attributes[ a ] >= 0 ) _gl.enableVertexAttribArray( attributes[ a ] );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ( material.morphTargets ) {
|
||||
|
||||
material.numSupportedMorphTargets = 0;
|
||||
@@ -2509,12 +2513,16 @@ THREE.WebGLRenderer = function ( parameters ) {
|
||||
|
||||
for( a in material.attributes ) {
|
||||
|
||||
if( attributes[ a ] >= 0 ) {
|
||||
if( attributes[ a ] !== undefined && attributes[ a ] >= 0 ) {
|
||||
|
||||
attribute = material.attributes[ a ];
|
||||
|
||||
_gl.bindBuffer( _gl.ARRAY_BUFFER, attribute.buffer );
|
||||
_gl.vertexAttribPointer( attributes[ a ], attribute.size, _gl.FLOAT, false, 0, 0 );
|
||||
if( attribute.buffer ) {
|
||||
|
||||
_gl.bindBuffer( _gl.ARRAY_BUFFER, attribute.buffer );
|
||||
_gl.vertexAttribPointer( attributes[ a ], attribute.size, _gl.FLOAT, false, 0, 0 );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user