Hi,
I’ve created a tree by combining 2 planes in crisscross order using maya. For material i’ve used both color and alpha map.And combined using copyChannel method.
here is the code:
var colorMap:BitmapData = TexturePool.getBitmapData(“tree_color_map”);
var alphaMap:BitmapData = TexturePool.getBitmapData(“tree_alpha_map”);
var combinedBitmap:BitmapData = new BitmapData(colorMap.width, colorMap.height, true);
combinedBitmap.copyPixels(colorMap, new Rectangle(0, 0, colorMap.width, colorMap.height), new Point());
combinedBitmap.copyChannel(alphaMap, new Rectangle(0, 0, alphaMap.width, alphaMap.height), new Point(), 1, BitmapDataChannel.ALPHA);
var bitmapTexture:BitmapTexture = new BitmapTexture(combinedBitmap);
mesh.material = new TextureMaterial(bitmapTexture);
TextureMaterial(mesh.material).alphaBlending = true;
But it shows transparency problem, I can see the plane through other plane. I’ve attached the screenshot, the transparent area is marked in red.
Anybody knows how to fix this issue?
Thanks