Browse Source

Merge pull request #13519 from takahirox/WebGLTextureUpdate

Clean up WebGLTexture
Mr.doob 7 years ago
parent
commit
99244cd907
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/renderers/webgl/WebGLTextures.js

+ 2 - 1
src/renderers/webgl/WebGLTextures.js

@@ -85,9 +85,10 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 
 
 		_gl.generateMipmap( target );
 		_gl.generateMipmap( target );
 
 
+		// We assume images for cube map have the same size.
 		var image = Array.isArray( texture.image ) ? texture.image[ 0 ] : texture.image;
 		var image = Array.isArray( texture.image ) ? texture.image[ 0 ] : texture.image;
 		var textureProperties = properties.get( texture );
 		var textureProperties = properties.get( texture );
-		textureProperties.__maxMipLevel = Math.max( Math.log2( Math.max( image.width, image.height ) ), textureProperties.__maxMipLevel );
+		textureProperties.__maxMipLevel = Math.log2( Math.max( image.width, image.height ) );
 
 
 	}
 	}