From 3ad2a3cf670395cb6dc823b373157aac056f6e24 Mon Sep 17 00:00:00 2001 From: Juke Date: Wed, 9 Sep 2026 16:46:21 +0200 Subject: [PATCH] Bugfix: Clear the atlas texture before combining quads. --- .../Scripts/Editor/Utils/MA_TextureAtlasserProUtils.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Assets/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Utils/MA_TextureAtlasserProUtils.cs b/Assets/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Utils/MA_TextureAtlasserProUtils.cs index d255614..03a15ae 100644 --- a/Assets/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Utils/MA_TextureAtlasserProUtils.cs +++ b/Assets/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Utils/MA_TextureAtlasserProUtils.cs @@ -521,6 +521,13 @@ namespace MA_TextureAtlasserPro name = atlas.name + "_" + atlas.textureGroupRegistration[i].name }; + //A new Texture2D is uninitialised, and MA_Combine2D only writes inside each quad's + //guiRect, so every texel no quad covers keeps whatever was left in the buffer. That + //garbage is opaque enough to survive an alpha cutoff and bleeds into the quads + //through the mip chain, so clear the atlas to transparent black before combining. + newTexture.SetPixels32(new Color32[newTexture.width * newTexture.height]); + newTexture.Apply(); + foreach (MA_TextureAtlasserProQuad q in atlas.textureQuads) { if (q.textureGroups != null && q.textureGroups[i].texture != null)