Let’s make things right, the alternativa3d’s wonderful Translucent order in Away3D
Software: Away3D 4.x
tree, Newbie Posted: 23 September 2012 04:43 AM Total Posts: 6
yestoday,i readed alternativa3d8’s example files.
in the example named alphatestexample i found alternativa3d8 got a really good translucent order.
the translucent order in away3D has makes me headache in a long time.
at last i’v found the way thanks alternativa3d8
guys just do this:
one mesh has a material set the alphaThreshold = 0.9;
another mesh has a same geometry but with a material set alphaBlending = true;
that’s all.
the first material makes the order right,and the second material will gives the material’s edge quality
it’s really a good idea. just try it.
tree, Newbie Posted: 23 September 2012 04:49 AM Total Posts: 6
[ # 1 ]
and this is the result in away3D
tree, Newbie Posted: 23 September 2012 04:50 AM Total Posts: 6
[ # 2 ]
hope this will help you
rewb0rn, Newbie Posted: 07 January 2013 10:42 AM Total Posts: 8
[ # 3 ]
Wow sounds awesome, have been looking for a solution for a long time. Can you elaborate a bit or show some code? So you are loading the same mesh twice, adding it to the same parent and render them both? Or do you actually set one to invisible? I am just wondering if you would get artefacts rendering them both.
The approach should work independent of the object right? I am going to try this with planes instead of meshes..
80prozent, Sr. Member Posted: 07 January 2013 06:26 PM Total Posts: 430
[ # 4 ]
hi
looks great, but i wonder about the performance cost since every mesh needs to get rendered 2 times. since both meshes share all buffers i think the performance loss shouldnt be that much.
@rewb0rn: a plane is a mesh too, so you should get the same results…
rewb0rn, Newbie Posted: 09 January 2013 09:43 AM Total Posts: 8
[ # 5 ]
Ok maybe my setting is a bit different:
I have several independent planes with alpha edges (card game). Using alphaBlending the order of the cards is distorted.
I tried the described approach and added first a mesh with a plane + material that uses alphaThreshold, then added a mesh with plane + material with alphaBlending. The result is now that the planes with alphaThreshold have a stable order, but the planes with alphaBlending do not, which means in practice the card edges sometimes look smooth (when alphaBlending objects are in right order) and sometimes cropped (when alphaBlending order is distorted and only alphaThreshold planes are visible / in right order).
So does the described approach not work for me or am I doing it wrong?
bart_the_13th, Newbie Posted: 09 January 2013 11:06 AM Total Posts: 14
[ # 6 ]
Well, I did write some ffp shaders back then, and found that in order to force z-order to the transparent material one can force the material to write on z-buffer, but that still also create another problem since it depends on how your polygons drawn, if the transparent material is drawn first, you will be able to see right to the background.
But I do still found that the result still acceptable(most game still have the same artifact), now the problem is how to force transparent material to draw of z-buffer? I still cant find it unfortunately
rewb0rn, Newbie Posted: 09 January 2013 12:47 PM Total Posts: 8
[ # 7 ]
I just found the zOffset workaround as described here, I will use that one as it seems to be are more convenient solution in my case.