瀏覽代碼

EXRLoader no longer supports UnsignedByteType (#23059)

WestLangley 3 年之前
父節點
當前提交
1f3c121757
共有 1 個文件被更改,包括 6 次插入24 次删除
  1. 6 24
      examples/webgl_materials_matcap.html

+ 6 - 24
examples/webgl_materials_matcap.html

@@ -182,7 +182,7 @@
 
 				const loader = new EXRLoader();
 
-				loader.setDataType( THREE.UnsignedByteType ); // default: FloatType
+				loader.setDataType( THREE.HalfFloatType );
 
 				const texData = loader.parse( contents );
 
@@ -194,29 +194,11 @@
 
 				texture.format = texData.format;
 				texture.type = texData.type;
-
-				switch ( texture.type ) {
-
-					case THREE.UnsignedByteType:
-
-						texture.encoding = THREE.RGBEEncoding;
-						texture.minFilter = THREE.NearestFilter;
-						texture.magFilter = THREE.NearestFilter;
-						texture.generateMipmaps = false;
-						texture.flipY = false;
-						break;
-
-					case THREE.FloatType:
-					case THREE.HalfFloatType:
-
-						texture.encoding = THREE.LinearEncoding;
-						texture.minFilter = THREE.LinearFilter;
-						texture.magFilter = THREE.LinearFilter;
-						texture.generateMipmaps = false;
-						texture.flipY = false;
-						break;
-
-				}
+				texture.encoding = THREE.LinearEncoding;
+				texture.minFilter = THREE.LinearFilter;
+				texture.magFilter = THREE.LinearFilter;
+				texture.generateMipmaps = false;
+				texture.flipY = false;
 
 				updateMatcap( texture );