- Home /
Question by
Ahmed_Al_Asl · Mar 05, 2019 at 08:05 AM ·
texturegraphics
how Graphics.ConvertTexture work ?
I tried this but nothing happened , I also tried to change the texture format
int destinationSize = 500;
destinationTex = new Texture2D(destinationSize, destinationSize, TextureFormat.ARGB32, false);
for (int i = 0; i < destinationSize; i++)
{
for (int j = 0; j < destinationSize; j++)
{
destinationTex.SetPixel(i, j, Color.black);
}
}
destinationTex.Apply();
int sourceSize = 32;
sourceTex = new Texture2D(sourceSize, sourceSize, TextureFormat.ARGB32, false);
for (int i = 0; i < sourceSize; i++)
{
for (int j = 0; j < sourceSize; j++)
{
sourceTex.SetPixel(i, j, Color.white);
}
}
sourceTex.Apply();
Graphics.ConvertTexture(sourceTex, 0, destinationTex, 0);
sourceTex.Apply();
destinationTex.Apply();
Comment