diff --git a/Assets/Scripts/Editor/PolyHaven/PolyHavenMaterialBuilder.cs b/Assets/Scripts/Editor/PolyHaven/PolyHavenMaterialBuilder.cs index b3e1de9..158f6e7 100644 --- a/Assets/Scripts/Editor/PolyHaven/PolyHavenMaterialBuilder.cs +++ b/Assets/Scripts/Editor/PolyHaven/PolyHavenMaterialBuilder.cs @@ -40,6 +40,15 @@ namespace Chameleon.Editor.PolyHaven if (!string.IsNullOrEmpty(roughPath) || !string.IsNullOrEmpty(armPath)) metallicGlossPath = BuildMetallicSmoothness(folder, slug, roughPath, metalPath, armPath, maxSize); + // The roughness source is fully consumed into the packed map and never + // referenced by the material — drop it once the repack succeeded. + if (!string.IsNullOrEmpty(metallicGlossPath) && !string.IsNullOrEmpty(roughPath)) + { + AssetDatabase.DeleteAsset(roughPath); + byType.Remove(PolyHavenMapType.Rough); + Debug.Log($"[PolyHaven] Deleted consumed roughness source: {roughPath}"); + } + // AO comes from the dedicated map, or the ARM red channel as a fallback. string occlusionPath = null; if (byType.TryGetValue(PolyHavenMapType.AO, out var aoSeparate))