Browse Source

Merge pull request #13178 from cnspaha/patch-8

GLTFLoader: only refresh uniforms on correct material
Mr.doob 7 years ago
parent
commit
f09e1a6a9b
1 changed files with 6 additions and 0 deletions
  1. 6 0
      examples/js/loaders/GLTFLoader.js

+ 6 - 0
examples/js/loaders/GLTFLoader.js

@@ -606,6 +606,12 @@ THREE.GLTFLoader = ( function () {
 			// Here's based on refreshUniformsCommon() and refreshUniformsStandard() in WebGLRenderer.
 			refreshUniforms: function ( renderer, scene, camera, geometry, material, group ) {
 
+				if ( material.isGLTFSpecularGlossinessMaterial !== true ) {
+
+					return;
+
+				}
+
 				var uniforms = material.uniforms;
 				var defines = material.defines;