Re: Using transparent images as TextureSource (Unity)
Sure : Some kind of "white creamy" veil on transparent areas (in both cases : PNG prepared in photoshop or premultiplied in an editor extension).What do you mean with "no success" ? Could you elaborate?* First, using Photoshop to perform the premultiplication => no success
Re: Using transparent images as TextureSource (Unity)
Only when activating compression in Unity or always?
Re: Using transparent images as TextureSource (Unity)
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:
And later found this: http://www.noesisengine.com/forums/view ... t=10#p6097

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:
Code: Select all
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;
}
}

Who is online
Users browsing this forum: No registered users and 5 guests