I want to clone a TextureMaterial, modify it and keep the original and the clone for later use.
What I did so far is following:
var BT:BitmapTexture = defaultMaterial.texture as BitmapTexture;
var BD:BitmapData = BT.bitmapData;
var clone:BitmapData = BD.clone();
var newBT:BitmapTexture = new BitmapTexture(clone);
transparentMaterial = new TextureMaterial(newBT, false, true);
transparentMaterial.lightPicker = defaultMaterial.lightPicker;
But the cloned TextureMaterial does not look like the original (see attachment). Can anyone help me with that problem please? I think i am missing some important information from the texture? uv-coordinates maybe or something like that.
I also posted my problem here with an additional image as attachment: http://away3d.com/forum/viewthread/5956/
I solved the Problem. It was just one wrong parameter. I enable mipmaping for the clone, but the original does not have mipmaping enabled.
The working Soulution looks like this: