Adding alphaBlending to TextureMaterial changes rendering order

Software: Away3D 4.x

mattmogford, Newbie
Posted: 09 July 2013 02:53 PM   Total Posts: 23

Hi All,

I’m having a problem as described in the title where if I set texture.alphaBlending = true;
The z-order / rendering order becomes incorrect ( See Screenshot ).

If I don’t use alpha blending but instead set alphaThreshold to 0.8 for example it works, but the sem-transparent pixels on the edge are black and when the camera moves there is horrible ‘jaggedness’ on the affected Sprites. Code below >>

objTextureMaterial = new TextureMaterial( new BitmapTexturespritesheetObject.bitmap.bitmapData ), truefalsetrue );
//objTextureMaterial.alphaThreshold = 0.8;
objTextureMaterial.alphaBlending true;
objTextureMaterial.smooth true;
materialDictionary[ materialName ] objTextureMaterial

Does anyone know why this is happening? And if so how to fix it please?

Thanks for any help.

Matt

 

   

mattmogford, Newbie
Posted: 09 July 2013 03:20 PM   Total Posts: 23   [ # 1 ]

Also, This game is for live tv.
This is the reason why alphaThreshold doesn’t look good enough.

   

Avatar
GoroMatsumoto, Sr. Member
Posted: 09 July 2013 03:24 PM   Total Posts: 166   [ # 2 ]

Hey, you are a lucky guy.
This problem was fixed in dev today.
https://github.com/away3d/away3d-core-fp11/issues/605

Try to use latest dev.
Cheers.

   

mattmogford, Newbie
Posted: 09 July 2013 03:39 PM   Total Posts: 23   [ # 3 ]

Amazing! Thank you!
Can I download a swc with that fix built in it now?
Or do I need to compile it myself?

Thanks

   

Avatar
GoroMatsumoto, Sr. Member
Posted: 09 July 2013 03:41 PM   Total Posts: 166   [ # 4 ]
objTextureMaterial = new TextureMaterial( new BitmapTexturespritesheetObject.bitmap.bitmapData ));
objTextureMaterial.alphaThreshold 0.8;
objTextureMaterial.alphaPremultiplied true;
objTextureMaterial.smooth false

If you want to use alphaThreshold,
you should check “alphaPremultiplied = true”
and “smooth = false”.

That will reduce the black edge artifacts.

   

Avatar
GoroMatsumoto, Sr. Member
Posted: 09 July 2013 03:48 PM   Total Posts: 166   [ # 5 ]

No, there is no SWC that included this fix.
As far as I know.
https://github.com/away3d/away3d-core-fp11/tree/dev

   

mattmogford, Newbie
Posted: 09 July 2013 04:10 PM   Total Posts: 23   [ # 6 ]

I created an Actionscript Library project with the /dev branch.
Compiled a swc.
And alphaPremultiplied = true; now works a treat.
Super Smooth.
Thank you

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X