Browse Source

Merge pull request #13714 from aardgoose/log2

open code log2 replacement for IE11 compat
Mr.doob 7 years ago
parent
commit
7cb08aa88f
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/renderers/webgl/WebGLTextures.js

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

@@ -93,7 +93,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 		_gl.generateMipmap( target );
 
 		var textureProperties = properties.get( texture );
-		textureProperties.__maxMipLevel = Math.log2( Math.max( width, height ) );
+
+		// Note: Math.log( x ) * Math.LOG2E used instead of Math.log2( x ) which is not supported by IE11
+		textureProperties.__maxMipLevel = Math.log( Math.max( width, height ) ) * Math.LOG2E;
 
 	}