|
@@ -12763,7 +12763,7 @@ function WebGLAttributes( gl, capabilities ) {
|
|
|
|
|
|
if ( attribute.isGLBufferAttribute ) {
|
|
|
|
|
|
- var cached = buffers.get( attribute );
|
|
|
+ const cached = buffers.get( attribute );
|
|
|
|
|
|
if ( ! cached || cached.version < attribute.version ) {
|
|
|
|
|
@@ -14189,7 +14189,7 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
|
|
|
const cachedAttributes = currentState.attributes;
|
|
|
const geometryAttributes = geometry.attributes;
|
|
|
|
|
|
- if ( Object.keys( cachedAttributes ).length !== Object.keys( geometryAttributes ).length ) return true;
|
|
|
+ let attributesNum = 0;
|
|
|
|
|
|
for ( const key in geometryAttributes ) {
|
|
|
|
|
@@ -14202,8 +14202,12 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
|
|
|
|
|
|
if ( cachedAttribute.data !== geometryAttribute.data ) return true;
|
|
|
|
|
|
+ attributesNum ++;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+ if ( currentState.attributesNum !== attributesNum ) return true;
|
|
|
+
|
|
|
if ( currentState.index !== index ) return true;
|
|
|
|
|
|
return false;
|
|
@@ -14214,6 +14218,7 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
|
|
|
|
|
|
const cache = {};
|
|
|
const attributes = geometry.attributes;
|
|
|
+ let attributesNum = 0;
|
|
|
|
|
|
for ( const key in attributes ) {
|
|
|
|
|
@@ -14230,9 +14235,12 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
|
|
|
|
|
|
cache[ key ] = data;
|
|
|
|
|
|
+ attributesNum ++;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
currentState.attributes = cache;
|
|
|
+ currentState.attributesNum = attributesNum;
|
|
|
|
|
|
currentState.index = index;
|
|
|
|
|
@@ -24687,7 +24695,7 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
if ( capabilities.floatVertexTextures ) {
|
|
|
|
|
|
- if ( skeleton.boneTexture === undefined ) {
|
|
|
+ if ( skeleton.boneTexture === null ) {
|
|
|
|
|
|
// layout (1 matrix = 4 pixels)
|
|
|
// RGBA RGBA RGBA RGBA (=> column1, column2, column3, column4)
|
|
@@ -26229,6 +26237,10 @@ function Skeleton( bones = [], boneInverses = [] ) {
|
|
|
|
|
|
this.bones = bones.slice( 0 );
|
|
|
this.boneInverses = boneInverses;
|
|
|
+ this.boneMatrices = null;
|
|
|
+
|
|
|
+ this.boneTexture = null;
|
|
|
+ this.boneTextureSize = 0;
|
|
|
|
|
|
this.frame = - 1;
|
|
|
|
|
@@ -26356,7 +26368,7 @@ Object.assign( Skeleton.prototype, {
|
|
|
|
|
|
}
|
|
|
|
|
|
- if ( boneTexture !== undefined ) {
|
|
|
+ if ( boneTexture !== null ) {
|
|
|
|
|
|
boneTexture.needsUpdate = true;
|
|
|
|
|
@@ -26390,11 +26402,11 @@ Object.assign( Skeleton.prototype, {
|
|
|
|
|
|
dispose: function ( ) {
|
|
|
|
|
|
- if ( this.boneTexture ) {
|
|
|
+ if ( this.boneTexture !== null ) {
|
|
|
|
|
|
this.boneTexture.dispose();
|
|
|
|
|
|
- this.boneTexture = undefined;
|
|
|
+ this.boneTexture = null;
|
|
|
|
|
|
}
|
|
|
|