Author Topic: Question of Alpha sorting system  (Read 162 times)

Jason Huang   «   on: May 17, 2012, 01:41:45 PM »

Hi, all.
Glad the new Flash 2.5 will be releasing soon. We are so excited.
We got a complex alpha sorting issue which using current alpha sorting system dose not work with.
I guess that the current sort mode is depending on the distance between meshes and camera.
So the problem occured, we attended to build a tree by  a large mount of leaves. And for each of the leaves are build by bended planes. we have to use texture with alpha for those leaves. I believe this is the most common way to build a complex and detailed tree. All of the leaves, they stacked,
overlayed, intersected.. and might have various pivot center.
And in this case, there is no way to get a correct alpha sorting, unless we use AlphaMaskFilter.
But the hard edges are unpleased.....
I believe that the hard edges are come from the alpha pixels of PNG file. And might related to 
Context3D.setBlendFactors?Context3DBlendFactor.SOURCE_ALPHA?Context3DBlendFactor.ONE_MINUS_SOURCE_ALPHA)
So should we have a try to do something like 3Dmax? using colors for Alpha channel instead of Alpha pixel?

Cheers

Jason Huang   «   Reply #1 on: May 17, 2012, 01:43:45 PM »

And by the way, set shader.sourceFactor to "one"  dose not work in this case. because they might automaticly blend to the colors behind the shader.

Ariel Nehmad   «   Reply #2 on: May 17, 2012, 07:33:33 PM »
Hi Jason, alpha is always an issue when working with the gpu, but there are a few techniques that may solve your problem..."order independent transparency"...but requires some "by hand" rendering and maybe some shader programming.

I'll try to do something on this, but I can not promise to do in the short term...we want to release v2.5 as soon as possible ;)

Jason Huang   «   Reply #3 on: May 18, 2012, 12:13:32 AM »
thx, Ariel. I'm looking forward to it:)