Stand today for the same problem: "Whats going on? Why are the image's alpha's wrong ?"
Found the script
here and wrapped it in an "Context Menue Option".
So the textures, that need to be premultplyed, can be selected and converted in unity Asset Browser.
For everyone interested:
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public class PremultplyTextureContext : Editor {
[MenuItem("Assets/PremultplyTexture")]
public static void onpremultiplycontext()
{
foreach (Object obj in Selection.objects)
{
Texture2D tex = obj as Texture2D;
Debug.Log("Premultiplyed :" + tex.name);
string path = AssetDatabase.GetAssetPath(tex);
Texture2D texOut = TextureConverter.ConvertToPremultipliedAlpha(tex);
byte[] data = texOut.EncodeToPNG();
System.IO.File.WriteAllBytes(path, data);
}
AssetDatabase.Refresh();
}
[MenuItem("Assets/PremultplyTexture",true)]
public static bool checkpremultiplycontext()
{
bool returnValue = true;
foreach (Object obj in Selection.objects)
{
if (!(obj is Texture2D)) returnValue = false;
}
return returnValue;
}
}
And later found this:
http://www.noesisengine.com/forums/view ... t=10#p6097
