AlphaMaskMethod

Software: Away3D 4.x

ranoya, Newbie
Posted: 12 February 2014 08:42 AM   Total Posts: 29

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?

 

   

rdoi, Member
Posted: 13 February 2014 12:58 PM   Total Posts: 86   [ # 1 ]

As we already talked, it looks like it is a bug already detected by @dikmene: http://away3d.com/forum/viewthread/4021/

So I submitted as an issue in the Github:
https://github.com/away3d/away3d-core-fp11/issues/679

The problem that remains is the alphaBlending=true requirement, that causes z-order problems by itself…

   

ranoya, Newbie
Posted: 13 February 2014 06:00 PM   Total Posts: 29   [ # 2 ]

Thanks for the information and initiative.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X