|
@@ -125,9 +125,6 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
_currentWidth = 0,
|
|
_currentWidth = 0,
|
|
_currentHeight = 0,
|
|
_currentHeight = 0,
|
|
|
|
|
|
- _newAttributes = new Uint8Array( 16 ),
|
|
|
|
- _enabledAttributes = new Uint8Array( 16 ),
|
|
|
|
-
|
|
|
|
// frustum
|
|
// frustum
|
|
|
|
|
|
_frustum = new THREE.Frustum(),
|
|
_frustum = new THREE.Frustum(),
|
|
@@ -280,12 +277,6 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
_lightsNeedUpdate = true;
|
|
_lightsNeedUpdate = true;
|
|
|
|
|
|
- for ( var i = 0; i < _enabledAttributes.length; i ++ ) {
|
|
|
|
-
|
|
|
|
- _enabledAttributes[ i ] = 0;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
state.reset();
|
|
state.reset();
|
|
|
|
|
|
};
|
|
};
|
|
@@ -2330,7 +2321,7 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
this.renderBufferImmediate = function ( object, program, material ) {
|
|
this.renderBufferImmediate = function ( object, program, material ) {
|
|
|
|
|
|
- initAttributes();
|
|
|
|
|
|
+ state.initAttributes();
|
|
|
|
|
|
if ( object.hasPositions && ! object.__webglVertexBuffer ) object.__webglVertexBuffer = _gl.createBuffer();
|
|
if ( object.hasPositions && ! object.__webglVertexBuffer ) object.__webglVertexBuffer = _gl.createBuffer();
|
|
if ( object.hasNormals && ! object.__webglNormalBuffer ) object.__webglNormalBuffer = _gl.createBuffer();
|
|
if ( object.hasNormals && ! object.__webglNormalBuffer ) object.__webglNormalBuffer = _gl.createBuffer();
|
|
@@ -2341,7 +2332,9 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, object.__webglVertexBuffer );
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, object.__webglVertexBuffer );
|
|
_gl.bufferData( _gl.ARRAY_BUFFER, object.positionArray, _gl.DYNAMIC_DRAW );
|
|
_gl.bufferData( _gl.ARRAY_BUFFER, object.positionArray, _gl.DYNAMIC_DRAW );
|
|
- enableAttribute( program.attributes.position );
|
|
|
|
|
|
+
|
|
|
|
+ state.enableAttribute( program.attributes.position );
|
|
|
|
+
|
|
_gl.vertexAttribPointer( program.attributes.position, 3, _gl.FLOAT, false, 0, 0 );
|
|
_gl.vertexAttribPointer( program.attributes.position, 3, _gl.FLOAT, false, 0, 0 );
|
|
|
|
|
|
}
|
|
}
|
|
@@ -2394,7 +2387,9 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
}
|
|
}
|
|
|
|
|
|
_gl.bufferData( _gl.ARRAY_BUFFER, object.normalArray, _gl.DYNAMIC_DRAW );
|
|
_gl.bufferData( _gl.ARRAY_BUFFER, object.normalArray, _gl.DYNAMIC_DRAW );
|
|
- enableAttribute( program.attributes.normal );
|
|
|
|
|
|
+
|
|
|
|
+ state.enableAttribute( program.attributes.normal );
|
|
|
|
+
|
|
_gl.vertexAttribPointer( program.attributes.normal, 3, _gl.FLOAT, false, 0, 0 );
|
|
_gl.vertexAttribPointer( program.attributes.normal, 3, _gl.FLOAT, false, 0, 0 );
|
|
|
|
|
|
}
|
|
}
|
|
@@ -2403,7 +2398,9 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, object.__webglUvBuffer );
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, object.__webglUvBuffer );
|
|
_gl.bufferData( _gl.ARRAY_BUFFER, object.uvArray, _gl.DYNAMIC_DRAW );
|
|
_gl.bufferData( _gl.ARRAY_BUFFER, object.uvArray, _gl.DYNAMIC_DRAW );
|
|
- enableAttribute( program.attributes.uv );
|
|
|
|
|
|
+
|
|
|
|
+ state.enableAttribute( program.attributes.uv );
|
|
|
|
+
|
|
_gl.vertexAttribPointer( program.attributes.uv, 2, _gl.FLOAT, false, 0, 0 );
|
|
_gl.vertexAttribPointer( program.attributes.uv, 2, _gl.FLOAT, false, 0, 0 );
|
|
|
|
|
|
}
|
|
}
|
|
@@ -2412,12 +2409,14 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, object.__webglColorBuffer );
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, object.__webglColorBuffer );
|
|
_gl.bufferData( _gl.ARRAY_BUFFER, object.colorArray, _gl.DYNAMIC_DRAW );
|
|
_gl.bufferData( _gl.ARRAY_BUFFER, object.colorArray, _gl.DYNAMIC_DRAW );
|
|
- enableAttribute( program.attributes.color );
|
|
|
|
|
|
+
|
|
|
|
+ state.enableAttribute( program.attributes.color );
|
|
|
|
+
|
|
_gl.vertexAttribPointer( program.attributes.color, 3, _gl.FLOAT, false, 0, 0 );
|
|
_gl.vertexAttribPointer( program.attributes.color, 3, _gl.FLOAT, false, 0, 0 );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- disableUnusedAttributes();
|
|
|
|
|
|
+ state.disableUnusedAttributes();
|
|
|
|
|
|
_gl.drawArrays( _gl.TRIANGLES, 0, object.count );
|
|
_gl.drawArrays( _gl.TRIANGLES, 0, object.count );
|
|
|
|
|
|
@@ -2447,7 +2446,7 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryAttribute.buffer );
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryAttribute.buffer );
|
|
|
|
|
|
- enableAttribute( programAttribute );
|
|
|
|
|
|
+ state.enableAttribute( programAttribute );
|
|
|
|
|
|
_gl.vertexAttribPointer( programAttribute, size, _gl.FLOAT, false, 0, startIndex * size * 4 ); // 4 bytes per Float32
|
|
_gl.vertexAttribPointer( programAttribute, size, _gl.FLOAT, false, 0, startIndex * size * 4 ); // 4 bytes per Float32
|
|
|
|
|
|
@@ -2469,7 +2468,7 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- disableUnusedAttributes();
|
|
|
|
|
|
+ state.disableUnusedAttributes();
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2494,7 +2493,7 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
if ( updateBuffers ) {
|
|
if ( updateBuffers ) {
|
|
|
|
|
|
- initAttributes();
|
|
|
|
|
|
+ state.initAttributes();
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2835,7 +2834,7 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
if ( updateBuffers ) {
|
|
if ( updateBuffers ) {
|
|
|
|
|
|
- initAttributes();
|
|
|
|
|
|
+ state.initAttributes();
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2846,7 +2845,9 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
if ( updateBuffers ) {
|
|
if ( updateBuffers ) {
|
|
|
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglVertexBuffer );
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglVertexBuffer );
|
|
- enableAttribute( attributes.position );
|
|
|
|
|
|
+
|
|
|
|
+ state.enableAttribute( attributes.position );
|
|
|
|
+
|
|
_gl.vertexAttribPointer( attributes.position, 3, _gl.FLOAT, false, 0, 0 );
|
|
_gl.vertexAttribPointer( attributes.position, 3, _gl.FLOAT, false, 0, 0 );
|
|
|
|
|
|
}
|
|
}
|
|
@@ -2877,7 +2878,9 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
if ( attributes[ attribute.buffer.belongsToAttribute ] >= 0 ) {
|
|
if ( attributes[ attribute.buffer.belongsToAttribute ] >= 0 ) {
|
|
|
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, attribute.buffer );
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, attribute.buffer );
|
|
- enableAttribute( attributes[ attribute.buffer.belongsToAttribute ] );
|
|
|
|
|
|
+
|
|
|
|
+ state.enableAttribute( attributes[ attribute.buffer.belongsToAttribute ] );
|
|
|
|
+
|
|
_gl.vertexAttribPointer( attributes[ attribute.buffer.belongsToAttribute ], attribute.size, _gl.FLOAT, false, 0, 0 );
|
|
_gl.vertexAttribPointer( attributes[ attribute.buffer.belongsToAttribute ], attribute.size, _gl.FLOAT, false, 0, 0 );
|
|
|
|
|
|
}
|
|
}
|
|
@@ -2894,7 +2897,9 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
if ( object.geometry.colors.length > 0 || object.geometry.faces.length > 0 ) {
|
|
if ( object.geometry.colors.length > 0 || object.geometry.faces.length > 0 ) {
|
|
|
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglColorBuffer );
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglColorBuffer );
|
|
- enableAttribute( attributes.color );
|
|
|
|
|
|
+
|
|
|
|
+ state.enableAttribute( attributes.color );
|
|
|
|
+
|
|
_gl.vertexAttribPointer( attributes.color, 3, _gl.FLOAT, false, 0, 0 );
|
|
_gl.vertexAttribPointer( attributes.color, 3, _gl.FLOAT, false, 0, 0 );
|
|
|
|
|
|
} else if ( material.defaultAttributeValues !== undefined ) {
|
|
} else if ( material.defaultAttributeValues !== undefined ) {
|
|
@@ -2911,7 +2916,9 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
if ( attributes.normal >= 0 ) {
|
|
if ( attributes.normal >= 0 ) {
|
|
|
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglNormalBuffer );
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglNormalBuffer );
|
|
- enableAttribute( attributes.normal );
|
|
|
|
|
|
+
|
|
|
|
+ state.enableAttribute( attributes.normal );
|
|
|
|
+
|
|
_gl.vertexAttribPointer( attributes.normal, 3, _gl.FLOAT, false, 0, 0 );
|
|
_gl.vertexAttribPointer( attributes.normal, 3, _gl.FLOAT, false, 0, 0 );
|
|
|
|
|
|
}
|
|
}
|
|
@@ -2921,7 +2928,9 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
if ( attributes.tangent >= 0 ) {
|
|
if ( attributes.tangent >= 0 ) {
|
|
|
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglTangentBuffer );
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglTangentBuffer );
|
|
- enableAttribute( attributes.tangent );
|
|
|
|
|
|
+
|
|
|
|
+ state.enableAttribute( attributes.tangent );
|
|
|
|
+
|
|
_gl.vertexAttribPointer( attributes.tangent, 4, _gl.FLOAT, false, 0, 0 );
|
|
_gl.vertexAttribPointer( attributes.tangent, 4, _gl.FLOAT, false, 0, 0 );
|
|
|
|
|
|
}
|
|
}
|
|
@@ -2933,7 +2942,9 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
if ( object.geometry.faceVertexUvs[ 0 ] ) {
|
|
if ( object.geometry.faceVertexUvs[ 0 ] ) {
|
|
|
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglUVBuffer );
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglUVBuffer );
|
|
- enableAttribute( attributes.uv );
|
|
|
|
|
|
+
|
|
|
|
+ state.enableAttribute( attributes.uv );
|
|
|
|
+
|
|
_gl.vertexAttribPointer( attributes.uv, 2, _gl.FLOAT, false, 0, 0 );
|
|
_gl.vertexAttribPointer( attributes.uv, 2, _gl.FLOAT, false, 0, 0 );
|
|
|
|
|
|
} else if ( material.defaultAttributeValues !== undefined ) {
|
|
} else if ( material.defaultAttributeValues !== undefined ) {
|
|
@@ -2950,7 +2961,9 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
if ( object.geometry.faceVertexUvs[ 1 ] ) {
|
|
if ( object.geometry.faceVertexUvs[ 1 ] ) {
|
|
|
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglUV2Buffer );
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglUV2Buffer );
|
|
- enableAttribute( attributes.uv2 );
|
|
|
|
|
|
+
|
|
|
|
+ state.enableAttribute( attributes.uv2 );
|
|
|
|
+
|
|
_gl.vertexAttribPointer( attributes.uv2, 2, _gl.FLOAT, false, 0, 0 );
|
|
_gl.vertexAttribPointer( attributes.uv2, 2, _gl.FLOAT, false, 0, 0 );
|
|
|
|
|
|
} else if ( material.defaultAttributeValues !== undefined ) {
|
|
} else if ( material.defaultAttributeValues !== undefined ) {
|
|
@@ -2966,11 +2979,15 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
attributes.skinIndex >= 0 && attributes.skinWeight >= 0 ) {
|
|
attributes.skinIndex >= 0 && attributes.skinWeight >= 0 ) {
|
|
|
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglSkinIndicesBuffer );
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglSkinIndicesBuffer );
|
|
- enableAttribute( attributes.skinIndex );
|
|
|
|
|
|
+
|
|
|
|
+ state.enableAttribute( attributes.skinIndex );
|
|
|
|
+
|
|
_gl.vertexAttribPointer( attributes.skinIndex, 4, _gl.FLOAT, false, 0, 0 );
|
|
_gl.vertexAttribPointer( attributes.skinIndex, 4, _gl.FLOAT, false, 0, 0 );
|
|
|
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglSkinWeightsBuffer );
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglSkinWeightsBuffer );
|
|
- enableAttribute( attributes.skinWeight );
|
|
|
|
|
|
+
|
|
|
|
+ state.enableAttribute( attributes.skinWeight );
|
|
|
|
+
|
|
_gl.vertexAttribPointer( attributes.skinWeight, 4, _gl.FLOAT, false, 0, 0 );
|
|
_gl.vertexAttribPointer( attributes.skinWeight, 4, _gl.FLOAT, false, 0, 0 );
|
|
|
|
|
|
}
|
|
}
|
|
@@ -2980,14 +2997,16 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
if ( attributes.lineDistance >= 0 ) {
|
|
if ( attributes.lineDistance >= 0 ) {
|
|
|
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglLineDistanceBuffer );
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglLineDistanceBuffer );
|
|
- enableAttribute( attributes.lineDistance );
|
|
|
|
|
|
+
|
|
|
|
+ state.enableAttribute( attributes.lineDistance );
|
|
|
|
+
|
|
_gl.vertexAttribPointer( attributes.lineDistance, 1, _gl.FLOAT, false, 0, 0 );
|
|
_gl.vertexAttribPointer( attributes.lineDistance, 1, _gl.FLOAT, false, 0, 0 );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- disableUnusedAttributes();
|
|
|
|
|
|
+ state.disableUnusedAttributes();
|
|
|
|
|
|
// render mesh
|
|
// render mesh
|
|
|
|
|
|
@@ -3042,44 +3061,6 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
- function initAttributes() {
|
|
|
|
-
|
|
|
|
- for ( var i = 0, l = _newAttributes.length; i < l; i ++ ) {
|
|
|
|
-
|
|
|
|
- _newAttributes[ i ] = 0;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- function enableAttribute( attribute ) {
|
|
|
|
-
|
|
|
|
- _newAttributes[ attribute ] = 1;
|
|
|
|
-
|
|
|
|
- if ( _enabledAttributes[ attribute ] === 0 ) {
|
|
|
|
-
|
|
|
|
- _gl.enableVertexAttribArray( attribute );
|
|
|
|
- _enabledAttributes[ attribute ] = 1;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- function disableUnusedAttributes() {
|
|
|
|
-
|
|
|
|
- for ( var i = 0, l = _enabledAttributes.length; i < l; i ++ ) {
|
|
|
|
-
|
|
|
|
- if ( _enabledAttributes[ i ] !== _newAttributes[ i ] ) {
|
|
|
|
-
|
|
|
|
- _gl.disableVertexAttribArray( i );
|
|
|
|
- _enabledAttributes[ i ] = 0;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
function setupMorphTargets ( material, geometryGroup, object ) {
|
|
function setupMorphTargets ( material, geometryGroup, object ) {
|
|
|
|
|
|
// set base
|
|
// set base
|
|
@@ -3089,13 +3070,17 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
if ( object.morphTargetBase !== - 1 && attributes.position >= 0 ) {
|
|
if ( object.morphTargetBase !== - 1 && attributes.position >= 0 ) {
|
|
|
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglMorphTargetsBuffers[ object.morphTargetBase ] );
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglMorphTargetsBuffers[ object.morphTargetBase ] );
|
|
- enableAttribute( attributes.position );
|
|
|
|
|
|
+
|
|
|
|
+ state.enableAttribute( attributes.position );
|
|
|
|
+
|
|
_gl.vertexAttribPointer( attributes.position, 3, _gl.FLOAT, false, 0, 0 );
|
|
_gl.vertexAttribPointer( attributes.position, 3, _gl.FLOAT, false, 0, 0 );
|
|
|
|
|
|
} else if ( attributes.position >= 0 ) {
|
|
} else if ( attributes.position >= 0 ) {
|
|
|
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglVertexBuffer );
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglVertexBuffer );
|
|
- enableAttribute( attributes.position );
|
|
|
|
|
|
+
|
|
|
|
+ state.enableAttribute( attributes.position );
|
|
|
|
+
|
|
_gl.vertexAttribPointer( attributes.position, 3, _gl.FLOAT, false, 0, 0 );
|
|
_gl.vertexAttribPointer( attributes.position, 3, _gl.FLOAT, false, 0, 0 );
|
|
|
|
|
|
}
|
|
}
|
|
@@ -3117,7 +3102,9 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
if ( attribute >= 0 ) {
|
|
if ( attribute >= 0 ) {
|
|
|
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglMorphTargetsBuffers[ order[ m ] ] );
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglMorphTargetsBuffers[ order[ m ] ] );
|
|
- enableAttribute( attribute );
|
|
|
|
|
|
+
|
|
|
|
+ state.enableAttribute( attribute );
|
|
|
|
+
|
|
_gl.vertexAttribPointer( attribute, 3, _gl.FLOAT, false, 0, 0 );
|
|
_gl.vertexAttribPointer( attribute, 3, _gl.FLOAT, false, 0, 0 );
|
|
|
|
|
|
}
|
|
}
|
|
@@ -3127,7 +3114,9 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
if ( attribute >= 0 && material.morphNormals ) {
|
|
if ( attribute >= 0 && material.morphNormals ) {
|
|
|
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglMorphNormalsBuffers[ order[ m ] ] );
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglMorphNormalsBuffers[ order[ m ] ] );
|
|
- enableAttribute( attribute );
|
|
|
|
|
|
+
|
|
|
|
+ state.enableAttribute( attribute );
|
|
|
|
+
|
|
_gl.vertexAttribPointer( attribute, 3, _gl.FLOAT, false, 0, 0 );
|
|
_gl.vertexAttribPointer( attribute, 3, _gl.FLOAT, false, 0, 0 );
|
|
|
|
|
|
}
|
|
}
|
|
@@ -3189,7 +3178,9 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
if ( attribute >= 0 ) {
|
|
if ( attribute >= 0 ) {
|
|
|
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglMorphTargetsBuffers[ influenceIndex ] );
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglMorphTargetsBuffers[ influenceIndex ] );
|
|
- enableAttribute( attribute );
|
|
|
|
|
|
+
|
|
|
|
+ state.enableAttribute( attribute );
|
|
|
|
+
|
|
_gl.vertexAttribPointer( attribute, 3, _gl.FLOAT, false, 0, 0 );
|
|
_gl.vertexAttribPointer( attribute, 3, _gl.FLOAT, false, 0, 0 );
|
|
|
|
|
|
}
|
|
}
|
|
@@ -3199,9 +3190,10 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
if ( attribute >= 0 && material.morphNormals ) {
|
|
if ( attribute >= 0 && material.morphNormals ) {
|
|
|
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglMorphNormalsBuffers[ influenceIndex ] );
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglMorphNormalsBuffers[ influenceIndex ] );
|
|
- enableAttribute( attribute );
|
|
|
|
- _gl.vertexAttribPointer( attribute, 3, _gl.FLOAT, false, 0, 0 );
|
|
|
|
|
|
|
|
|
|
+ state.enableAttribute( attribute );
|
|
|
|
+
|
|
|
|
+ _gl.vertexAttribPointer( attribute, 3, _gl.FLOAT, false, 0, 0 );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|