Desktop and android different rendering

Software: Away3D 4.x

marbu, Newbie
Posted: 24 December 2013 04:00 PM   Total Posts: 3

Hi to all,
I try to develop a very simple app in air using A3D.
I’ve a scene with 3 balls with TextureMaterial and when I run the app on desktop it’s all ok:
Screenshot desktop

When I try the app on android it has some problems:
Android Screenshot

This is my code:

var tx:BitmapTexture event.asset as BitmapTexture;
    
    var 
txMaterial:TextureMaterial = new TextureMaterial(txtruefalsefalse);
    
txMaterial.repeat false;
    
txMaterial.bothSides true;
    
txMaterial.ambientColor 0xcccccc;
    
txMaterial.lightPicker Game.instance._lightPicker

I do some search and I find that alphaBlending can solve the problem but if I set:

txMaterial.alphaBlending true;
    
txMaterial.alphaThreshold 0.5

The result is the same on desktop and android but it is wrong: Screenshot with alphaBlending

It seems that the z-order with alphaBlending is right in android also but there are some other problems….

can someone help me?

thanks.

   

Avatar
theMightyAtom, Sr. Member
Posted: 26 December 2013 11:25 AM   Total Posts: 669   [ # 1 ]

If you use alphaBlending, you don’t need alphaThreshold.
Alphathreshold defines the point at which the material becomes invisible.
Alphablending uses the alpha value of each pixel.
That may not be the problem though. You will find a lot of threads about Alphabelnding and it’s possible effect on z-sorting.
Use alphathreshold alone, if you can use the sharp edges it produces.

Good Luck!

   

marbu, Newbie
Posted: 26 December 2013 11:38 AM   Total Posts: 3   [ # 2 ]

Hi thank you for your reply.
I solve my problem some minutes ago by removing: alphatreshold and alphablend.
I notice that the application xml doesn’t contain:

<depthAndStencil>true</depthAndStencil

ups… smile

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X