From b5a0935246c9c697776f7d8b93b69008a7c84804 Mon Sep 17 00:00:00 2001 From: Trimatix <1jasperlaw@gmail.com> Date: Wed, 8 May 2024 23:35:03 +0200 Subject: [PATCH 1/2] stop using alpha mode for ETC2 --- src/AEPi/codecs/Tex2ImgCodec.py | 2 +- src/AEPi/constants.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/AEPi/codecs/Tex2ImgCodec.py b/src/AEPi/codecs/Tex2ImgCodec.py index 63cb1d7..c539f59 100644 --- a/src/AEPi/codecs/Tex2ImgCodec.py +++ b/src/AEPi/codecs/Tex2ImgCodec.py @@ -16,7 +16,7 @@ CompressionFormat.DXT1: 5, CompressionFormat.DXT5: 6, CompressionFormat.ETC1: 0, - CompressionFormat.ETC2: 3 + CompressionFormat.ETC2: 2 } diff --git a/src/AEPi/constants.py b/src/AEPi/constants.py index ae94910..036d5be 100644 --- a/src/AEPi/constants.py +++ b/src/AEPi/constants.py @@ -5,7 +5,7 @@ FORMAT_PILLOW_MODES: Dict["CompressionFormat", str] = {} FORMAT_BITCOUNTS: Dict["CompressionFormat", int] = {} -BGRA_FORMATS: Set["CompressionFormat"] = set() +BGR_FORMATS: Set["CompressionFormat"] = set() MIPMAPPABLE_FORMATS: Set["CompressionFormat"] = set() MASK_MIPMAPPED_FLAG = 0b00000010 MASK_FORMAT_ID = 0b11111101 @@ -72,7 +72,7 @@ def supportsMipmapping(self): @property def isBgra(self): - return self in BGRA_FORMATS + return self in BGR_FORMATS FORMAT_PILLOW_MODES[CompressionFormat.Uncompressed] = "RGBA" # ? @@ -86,7 +86,7 @@ def isBgra(self): FORMAT_PILLOW_MODES[CompressionFormat.DXT3] = "RGBA" FORMAT_PILLOW_MODES[CompressionFormat.DXT5] = "RGBA" FORMAT_PILLOW_MODES[CompressionFormat.ETC1] = "RGB" -FORMAT_PILLOW_MODES[CompressionFormat.ETC2] = "RGBA" +FORMAT_PILLOW_MODES[CompressionFormat.ETC2] = "RGB" FORMAT_BITCOUNTS[CompressionFormat.Uncompressed] = 8 # ? FORMAT_BITCOUNTS[CompressionFormat.Uncompressed_UI] = 8 # ? @@ -101,8 +101,8 @@ def isBgra(self): FORMAT_BITCOUNTS[CompressionFormat.ETC1] = 4 FORMAT_BITCOUNTS[CompressionFormat.ETC2] = 8 # ? -BGRA_FORMATS.add(CompressionFormat.ETC1) -BGRA_FORMATS.add(CompressionFormat.ETC2) +BGR_FORMATS.add(CompressionFormat.ETC1) +BGR_FORMATS.add(CompressionFormat.ETC2) MIPMAPPABLE_FORMATS.add(CompressionFormat.PVRTC12A) MIPMAPPABLE_FORMATS.add(CompressionFormat.PVRTC14A) From 5e9d973d2f920994d3f21ca894d2766a9bb7df4b Mon Sep 17 00:00:00 2001 From: Trimatix <1jasperlaw@gmail.com> Date: Wed, 8 May 2024 23:38:45 +0200 Subject: [PATCH 2/2] use RGB for ETC2 instead of BGR --- src/AEPi/constants.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/AEPi/constants.py b/src/AEPi/constants.py index 036d5be..9c524b5 100644 --- a/src/AEPi/constants.py +++ b/src/AEPi/constants.py @@ -102,7 +102,6 @@ def isBgra(self): FORMAT_BITCOUNTS[CompressionFormat.ETC2] = 8 # ? BGR_FORMATS.add(CompressionFormat.ETC1) -BGR_FORMATS.add(CompressionFormat.ETC2) MIPMAPPABLE_FORMATS.add(CompressionFormat.PVRTC12A) MIPMAPPABLE_FORMATS.add(CompressionFormat.PVRTC14A)