Jelajahi Sumber

Merge pull request #19882 from Mugen87/dev46

WebGLMaterials: Avoid undefined as maxMipLevel uniform value.
Mr.doob 5 tahun lalu
induk
melakukan
a03577e276
1 mengubah file dengan 7 tambahan dan 1 penghapusan
  1. 7 1
      src/renderers/webgl/WebGLMaterials.js

+ 7 - 1
src/renderers/webgl/WebGLMaterials.js

@@ -154,7 +154,13 @@ function WebGLMaterials( properties ) {
 			uniforms.reflectivity.value = material.reflectivity;
 			uniforms.reflectivity.value = material.reflectivity;
 			uniforms.refractionRatio.value = material.refractionRatio;
 			uniforms.refractionRatio.value = material.refractionRatio;
 
 
-			uniforms.maxMipLevel.value = properties.get( envMap ).__maxMipLevel;
+			var maxMipLevel = properties.get( envMap ).__maxMipLevel;
+
+			if ( maxMipLevel !== undefined ) {
+
+				uniforms.maxMipLevel.value = maxMipLevel;
+
+			}
 
 
 		}
 		}