瀏覽代碼

Added srgb flag to texture conversion to help mitigate color space issues

Clement Espeute 2 年之前
父節點
當前提交
4ac0d662d9
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      hxd/fs/Convert.hx

+ 5 - 1
hxd/fs/Convert.hx

@@ -302,7 +302,11 @@ class CompressIMG extends Convert {
 			try sys.FileSystem.deleteFile(tmpFile) catch( e : Dynamic ) {};
 			try sys.FileSystem.deleteFile(dstPath) catch( e : Dynamic ) {};
 			sys.io.File.copy(srcPath, tmpFile);
-			var args = ["-f", tcFmt, "-y", "-nologo", tmpFile];
+
+			// convert srgb textures to normal space
+			var srgbParam = hasParam("srgb") && getParam("srgb") ? "-srgb" : "";
+
+			var args = ["-f", tcFmt, "-y", "-nologo", srgbParam, tmpFile];
 			if( !mips ) args = ["-m", "1"].concat(args);
 			command("texconv", args);
 			sys.FileSystem.deleteFile(tmpFile);