From f490c7bf483210f3d749392b872e60fa0770f51b Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Tue, 16 Sep 2025 19:01:00 +0200 Subject: [PATCH] [unity] Changed default texture import settings from using PMA to straight alpha for better compatibility with Linear color space. --- .../Editor/spine-unity/Editor/Utility/Preferences.cs | 6 ++++-- .../spine-unity/Editor/Windows/SpinePreferences.cs | 12 +++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/Preferences.cs b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/Preferences.cs index 482ecee94..2db5f87d7 100644 --- a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/Preferences.cs +++ b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/Preferences.cs @@ -304,9 +304,11 @@ namespace Spine.Unity.Editor { EditorPrefs.SetString(DEFAULT_SHADER_KEY, defaultShader); SpineEditorUtilities.BoolPrefsField(ref setTextureImporterSettings, SET_TEXTUREIMPORTER_SETTINGS_KEY, new GUIContent("Apply Atlas Texture Settings", "Apply the recommended settings for Texture Importers.")); - SpineEditorUtilities.Texture2DPrefsField(ref textureSettingsReference, TEXTURE_SETTINGS_REFERENCE_KEY, new GUIContent("Atlas Texture Reference Settings", "Apply the selected reference texture import settings at newly imported atlas textures. When exporting atlas textures from Spine with \"Premultiply alpha\" enabled (the default), you can leave it at \"PMAPresetTemplate\". If you have disabled \"Premultiply alpha\", set it to \"StraightAlphaPresetTemplate\". You can also create your own reference texture asset and assign it here.")); + SpineEditorUtilities.Texture2DPrefsField(ref textureSettingsReference, TEXTURE_SETTINGS_REFERENCE_KEY, new GUIContent("Atlas Texture Reference Settings", "Apply the selected reference texture import settings at newly imported atlas textures.\n\n" + + "When exporting atlas textures from Spine with \"Premultiply alpha\" enabled (the default, requires Gamma color space), assign \"PMAPresetTemplate\". If you have disabled \"Premultiply alpha\", leave it at \"StraightAlphaPresetTemplate\".\n\n" + + "You can also create your own reference texture asset and assign it here.")); if (string.IsNullOrEmpty(textureSettingsReference)) { - string[] pmaTextureSettingsReferenceGUIDS = AssetDatabase.FindAssets("PMAPresetTemplate"); + string[] pmaTextureSettingsReferenceGUIDS = AssetDatabase.FindAssets("StraightAlphaPresetTemplate"); if (pmaTextureSettingsReferenceGUIDS.Length > 0) { textureSettingsReference = AssetDatabase.GUIDToAssetPath(pmaTextureSettingsReferenceGUIDS[0]); EditorPrefs.SetString(TEXTURE_SETTINGS_REFERENCE_KEY, textureSettingsReference); diff --git a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Windows/SpinePreferences.cs b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Windows/SpinePreferences.cs index 96e192a78..09d5deb9c 100644 --- a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Windows/SpinePreferences.cs +++ b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Windows/SpinePreferences.cs @@ -125,9 +125,9 @@ namespace Spine.Unity.Editor { return true; } - public const string DEFAULT_BLEND_MODE_MULTIPLY_MATERIAL = "SkeletonPMAMultiply"; - public const string DEFAULT_BLEND_MODE_SCREEN_MATERIAL = "SkeletonPMAScreen"; - public const string DEFAULT_BLEND_MODE_ADDITIVE_MATERIAL = "SkeletonPMAAdditive"; + public const string DEFAULT_BLEND_MODE_MULTIPLY_MATERIAL = "SkeletonStraightMultiply"; + public const string DEFAULT_BLEND_MODE_SCREEN_MATERIAL = "SkeletonStraightScreen"; + public const string DEFAULT_BLEND_MODE_ADDITIVE_MATERIAL = "SkeletonStraightAdditive"; public Material blendModeMaterialMultiply = null; public Material blendModeMaterialScreen = null; @@ -294,9 +294,11 @@ namespace Spine.Unity.Editor { EditorGUILayout.PropertyField(settings.FindProperty("setTextureImporterSettings"), new GUIContent("Apply Atlas Texture Settings", "Apply reference settings for Texture Importers.")); SerializedProperty textureSettingsRef = settings.FindProperty("textureSettingsReference"); - SpineEditorUtilities.PresetAssetPropertyField(textureSettingsRef, new GUIContent("Atlas Texture Settings", "Apply the selected texture import settings at newly imported atlas textures. When exporting atlas textures from Spine with \"Premultiply alpha\" enabled (the default), you can leave it at \"PMATexturePreset\". If you have disabled \"Premultiply alpha\", set it to \"StraightAlphaTexturePreset\". You can also create your own TextureImporter Preset asset and assign it here.")); + SpineEditorUtilities.PresetAssetPropertyField(textureSettingsRef, new GUIContent("Atlas Texture Settings", "Apply the selected texture import settings at newly imported atlas textures.\n\n" + + "When exporting atlas textures from Spine with \"Premultiply alpha\" enabled (the default), assign \"PMATexturePreset\". If you have disabled \"Premultiply alpha\", leave it at \"StraightAlphaPreset\".\n\n" + + "You can also create your own TextureImporter Preset asset and assign it here.")); if (string.IsNullOrEmpty(textureSettingsRef.stringValue)) { - string[] pmaTextureSettingsReferenceGUIDS = AssetDatabase.FindAssets("PMATexturePreset"); + string[] pmaTextureSettingsReferenceGUIDS = AssetDatabase.FindAssets("StraightAlphaPreset"); if (pmaTextureSettingsReferenceGUIDS.Length > 0) { string assetPath = AssetDatabase.GUIDToAssetPath(pmaTextureSettingsReferenceGUIDS[0]); if (!string.IsNullOrEmpty(assetPath))