瀏覽代碼

KTX2Loader: Don't select ETC1 for textures with alpha. (#22974)

Don McCurdy 3 年之前
父節點
當前提交
971f9b00a2
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      examples/jsm/loaders/KTX2Loader.js

+ 3 - 2
examples/jsm/loaders/KTX2Loader.js

@@ -519,8 +519,8 @@ KTX2Loader.BasisWorker = function () {
 		{
 			if: 'etc1Supported',
 			basisFormat: [ BasisFormat.ETC1S, BasisFormat.UASTC_4x4 ],
-			transcoderFormat: [ TranscoderFormat.ETC1, TranscoderFormat.ETC1 ],
-			engineFormat: [ EngineFormat.RGB_ETC1_Format, EngineFormat.RGB_ETC1_Format ],
+			transcoderFormat: [ TranscoderFormat.ETC1 ],
+			engineFormat: [ EngineFormat.RGB_ETC1_Format ],
 			priorityETC1S: 2,
 			priorityUASTC: 4,
 			needsPowerOfTwo: false,
@@ -560,6 +560,7 @@ KTX2Loader.BasisWorker = function () {
 
 			if ( ! config[ opt.if ] ) continue;
 			if ( ! opt.basisFormat.includes( basisFormat ) ) continue;
+			if ( hasAlpha && opt.transcoderFormat.length < 2 ) continue;
 			if ( opt.needsPowerOfTwo && ! ( isPowerOfTwo( width ) && isPowerOfTwo( height ) ) ) continue;
 
 			transcoderFormat = opt.transcoderFormat[ hasAlpha ? 1 : 0 ];