Transparent Particles

The problem I’m having is that the transparent parts of the particles are covering the other models. Instead of being able to see other models through the transparent parts, you’re seeing all the way to the background of the display region. In 3D models, I’ve solved this by using ’ alpha { binary }’. I’m using the steam particle system that exists in the samples.

If I’m not being clear, let me know - hopefully this image will help illustrate what’s happening. The left wall extends further, the purple circles are transparent paricles (the background is purple)

Applying binary transparency can also work on the particles (as long as you don’t need an antialiased edge). This can be done at run time, on the particle’s render node:

node.setTransparency(TransparencyAttrib.MBinary, 1)

Other approaches would be sorting the particles using binning so that they render following everything else in the scene, and so on.

Also, the fact that your particles are obscuring your world implies that transparency is enabled on your world (generally, transparent objects won’t obscure opaque objects). This may mean you’ve painted the walls with a 4-channel texture or done something else that enables transparency. If you don’t need transparency on your world, you should fix this; it will both solve the particle problem and also slightly improve your performance.


node.setTransparency(TransparencyAttrib.MBinary, 1)

Made the particles disappear.

Regarding transparency being enabled in the world - The textures were *.png and even though none of the image was transparent it was treating it as transparent (4 channels). After making them into jpegs, the transparency problems with the particles have been resolved. I’ll just stick with bitmaps from now on.


I tried to make some grass and I had problem with weird outlines.

they are not grey but transparent, if I use setTransparency(TransparencyAttrib.MBinary, 1) they are gone but I dont understand why

Use this on your textures:


That should get rid of the lines at the top.

About the outlines, this is explained in the Transparency and Blending manual page.