liaocheng / away3d-particles-system

A particle system based on Stage3D for Away3D engine
68 stars 16 forks source link

alpha problem with the particles and other objects #6

Closed David-Luis closed 12 years ago

David-Luis commented 12 years ago

Hi liaocheng,

I have an issue when use particles with alpha, that are draw ahead of objects of away3D (that have a texture with alpha). In this case, I see the away3D object instead my particles.

For example, if I have a smoke particles and a tree with a transparent texture, and I see the tree in front of the particles.

Any solution?

Thanks in advance

liaocheng commented 12 years ago

Hi, It's not a bug.For more information,please refer to http://away3d.com/forum/viewthread/414/#1183 A way to solve it is not use transparent texture to the tree.

David-Luis commented 12 years ago

Thanks liaocheng,

and using an alphaTresold in the particles would work?

liaocheng commented 12 years ago

Particles has not the alphaTresold property.Maybe you can have a try to the tree.

David-Luis commented 12 years ago

I tried that but it doesn't work.

Thanks anyway!

liaocheng commented 12 years ago

David Lenaerts said "It’s not exactly a bug per sé, it’s just a problem inherent to the way blending needs to happen. For reference: http://www.opengl.org/wiki/Transparency_Sorting There’s not really a way to sort per-polygon without entirely loosing the advantage of using GPU in the first place. Try to either stick to using the “alpha test” mentioned in the article (accomplished in Away3D 4 using the alphaThreshold property), or stick to (near-)convex shapes. If you look at real games, alpha blending is pretty rare - with the exception of planar objects (water, smoke particle and other effect billboards). --"

David-Luis commented 12 years ago

Okey, I didn't know was alphaThreshold. I know now, and it's work perfectly. (I didn't disable alphaBlending, it is why i doesn't work before)

Thanks liaocheng, you always solve my problems XD

liaocheng commented 12 years ago

Hi, I'm writing a particles editor.Please pay attention to http://liaocheng.github.com/