Hi everybody.
I need some help - or a bug confirmation - about this method. I’ve realized that many away3d users tried to use this class method without sucess, choosing for “embed” the alpha information in the diffuse texture alpha channel.
Unfortunately, this is not anoption for my case, cause a need to preserve the diffuse texture and change many times the alpha map during my application execution.
I’m not shure AlphaMaskMethod is bugged or not, but apparently it’s not doing what was supposed to do.
This simply code doesn’t work:
var alphaTexture:BitmapTexture = new BitmapTexture(new alphaMap().bitmapData);
var diffuseTexture:BitmapTexture = new BitmapTexture(new diffuseMap().bitmapData);
var material:TextureMaterial = new TextureMaterial(diffuseTewture);
var alphaMethod:AlphaMaskMethod = new AlphaMaskMethod(alphaTexture);
material.addMethod(alphaMethod);
The result is, in place of transparent pixels according to alphaMap, black and opaque ones.
I’ve already tried many combinations:
-turning on/off material’s alphaBlending;
-setting some value below 1 (0.999 for example) for alpha;
-using ColorMaterial in place of TextureMaterial;
-setting blendMode to LAYER or NORMAL;
-using a RGB black and white alpha texture;
-using a RGBA alpha texture;
I hope I’m stupidly missing something and this is not a bug.
Am I?