Explorar el Código

WebGLMaterials: Avoid undefined as maxMipLevel uniform value.

Mugen87 hace 5 años
padre
commit
5ced6c8115
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  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.refractionRatio.value = material.refractionRatio;
 
-			uniforms.maxMipLevel.value = properties.get( envMap ).__maxMipLevel;
+			var maxMipLevel = properties.get( envMap ).__maxMipLevel;
+
+			if ( maxMipLevel !== undefined ) {
+
+				uniforms.maxMipLevel.value = maxMipLevel;
+
+			}
 
 		}