understanding alpha channel in texture

Software: Away3D 4.x

Colir, Newbie
Posted: 30 November 2011 04:09 PM   Total Posts: 21

Hi,
i would like to know if you can help me to archive a transparent effect on texture.

my first question is to know, if it’s possible to use two textures, one as normal texturing, and the other (in black & white) to use as an alpha channel.

I ‘m thinking that it’s not possbile. Can you confirm me this ?

My second one is in case of using a png 24 texture :
i use a png 24 with transparent pixel

model loader.getChildAt(0)
var 
modelTexture model.material
var material:BitmapMaterial = new BitmapMaterial(modelTexture.bitmapData,true,false,false);
material.diffuseMethod.alphaThreshold 

but this have no effect..
i also try with

material.alphaBlending true

without success…

can you help me ?

thanks you very much

   

inSertCodE, Sr. Member
Posted: 30 November 2011 04:53 PM   Total Posts: 105   [ # 1 ]
Colir - 30 November 2011 04:09 PM

Hi,
my first question is to know, if it’s possible to use two textures, one as normal texturing, and the other (in black & white) to use as an alpha channel.

I ‘m thinking that it’s not possbile. Can you confirm me this ?

Actually you can. But preparing the texture is not done with away3d, at least I haven’t run into such property. You need to use flash bitmap properties to create the transparent bitmap and then use its bitmap data to make the texture.

   

Colir, Newbie
Posted: 30 November 2011 05:36 PM   Total Posts: 21   [ # 2 ]

ok,
but if i use flash bitmap properties to create the transparent bitmap,
i fall in my second problem…
alphatreshold and alphaBlending doesn’t give me any result…
The transparents pixels are still black…

Another point is if i use the flash bitmap properties to create the transparent bitmap, what is the advantage of this method compare to using directly a png texture ?

thanks for your help

   

inSertCodE, Sr. Member
Posted: 30 November 2011 11:28 PM   Total Posts: 105   [ # 3 ]
Colir - 30 November 2011 05:36 PM

ok,
Another point is if i use the flash bitmap properties to create the transparent bitmap, what is the advantage of this method compare to using directly a png texture ?

File size. The thing which really mater if you’re application is made for web.
For example, I have a texture size 1024x1024.
The PNG file size is 574 kb. On the other hand I get closely the same result with 2 images, 1 mask and 1 main, saved as JPG with only 215 kb.

...concerning your other problem take a look at this tutorial.
http://www.allforthecode.co.uk/aftc/forum/user/modules/forum/article.php?index=5&subindex=5&aid=306

   

Colir, Newbie
Posted: 01 December 2011 09:04 AM   Total Posts: 21   [ # 4 ]

Thanks for all your help.

Alpha channel on png work well.

However, if you have ever try this… :
In my case, i try to get alpha of the foliage on tree export via Vue9.5

I hink that the uv map it’s totally wrong, but in same case, trunk texture and foliage texture appear bo be well placed…very strange…
But when i’m applying alpha, transparence appear on the trunk…

thanks again

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X