- Home /
Question by
gwentech · Sep 13, 2012 at 11:48 AM ·
texture2dtransparencyimages
Multiple images into a Texture2D with transparency
I'm combining multiple images into one Texture2d, but any top-layer transparency pixels simply overwrite previously loaded images (instead of combining). Is there an easier way to combine them than my hack way shown below? Thanks.
t.SetPixels(scene_select_button_style.normal.background.GetPixels());
t.Apply();
Color[] c = daisy_texture.GetPixels(daisies*128,0,128,32);
for (int k = 0; k < 32; k++)
for (int l = 0; l < 128; l++)
if (c[k * 128+l].a > 0)
t.SetPixel(0 + l, 30 + k, c[k * 128+l]);
t.Apply();
Comment
You can write a quick shader which combine your textures together like in the unity documentaion : http://docs.unity3d.com/Documentation/$$anonymous$$anual/ShaderTut1.html (last part)