ソースを参照

Merge pull request #16686 from donmccurdy/bug-basistextureloader-ios

BasisTextureLoader: Fix example on iOS
Mr.doob 6 年 前
コミット
aab613b3fb

+ 3 - 0
docs/examples/loaders/BasisTextureLoader.html

@@ -60,6 +60,9 @@
 			desktop, Android, and iOS devices, and transcoded into DXT, ETC1, or
 			PVRTC1. Other output formats may be supported in the future.
 		</p>
+		<p>
+			Transcoding to PVRTC1 (for iOS) requires square power-of-two textures.
+		</p>
 		<p>
 			This loader relies on ES6 Promises and Web Assembly, which are not
 			supported in IE11.

+ 7 - 1
examples/js/loaders/BasisTextureLoader.js

@@ -167,7 +167,7 @@ THREE.BasisTextureLoader.prototype = {
 
 				}
 
-				texture.minFilter = THREE.LinearMipMapLinearFilter;
+				texture.minFilter = mipmaps.length === 1 ? THREE.LinearFilter : THREE.LinearMipMapLinearFilter;
 				texture.magFilter = THREE.LinearFilter;
 				texture.generateMipmaps = false;
 				texture.needsUpdate = true;
@@ -449,6 +449,12 @@ THREE.BasisTextureLoader.BasisWorker = function () {
 
 		}
 
+		if ( basisFile.getHasAlpha() ) {
+
+			console.warn( 'THREE.BasisTextureLoader: Alpha not yet implemented.' );
+
+		}
+
 		var mipmaps = [];
 
 		for ( var mip = 0; mip < levels; mip ++ ) {

BIN
examples/textures/compressed/PavingStones.basis


BIN
examples/textures/compressed/kodim20.basis


+ 1 - 1
examples/webgl_loader_texture_basis.html

@@ -51,7 +51,7 @@
 				loader.setTranscoderPath( 'js/libs/basis/' );
 				loader.detectSupport( renderer );
 
-				loader.load( 'textures/compressed/kodim20.basis', function ( texture ) {
+				loader.load( 'textures/compressed/PavingStones.basis', function ( texture ) {
 
 					texture.encoding = THREE.sRGBEncoding;
 					material.map = texture;