mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-14 11:01:36 +08:00
[unity] Changed default texture import settings from using PMA to straight alpha for better compatibility with Linear color space.
This commit is contained in:
parent
62458fa09e
commit
f490c7bf48
@ -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);
|
||||
|
||||
@ -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))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user