Browse Source

dont update uniforms after skeleton disposed

sjy 5 years ago
parent
commit
3956693af3
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/renderers/WebGLRenderer.js

+ 3 - 3
src/renderers/WebGLRenderer.js

@@ -1776,15 +1776,15 @@ function WebGLRenderer( parameters ) {
 
 
 		if ( material.skinning ) {
 		if ( material.skinning ) {
 
 
-			p_uniforms.setOptional( _gl, object, 'bindMatrix' );
-			p_uniforms.setOptional( _gl, object, 'bindMatrixInverse' );
-
 			var skeleton = object.skeleton;
 			var skeleton = object.skeleton;
 
 
 			if ( skeleton && !skeleton.disposed ) {
 			if ( skeleton && !skeleton.disposed ) {
 
 
 				var bones = skeleton.bones;
 				var bones = skeleton.bones;
 
 
+				p_uniforms.setOptional( _gl, object, 'bindMatrix' );
+				p_uniforms.setOptional( _gl, object, 'bindMatrixInverse' );	
+
 				if ( capabilities.floatVertexTextures ) {
 				if ( capabilities.floatVertexTextures ) {
 
 
 					if ( skeleton.boneTexture === undefined ) {
 					if ( skeleton.boneTexture === undefined ) {