In my current project I need to achieve the effect that is commonly seen in various sci-fi games, where, for example, multiple ships fire multiple semi-transparent beams. However, I am getting into the well-known issue that alpha on some of the beams cancels pixels of other beams, and also, occasionally, other transparent geometries that are in the 3D field (and I am very well aware of what is said here: Alpha/Transparency Sorting, Your Z-buffer, and You).
Currently all my beams are a single dynamic mesh with a simple texture that has alpha fade-off toward the edges, with blend mode set to alpha, and the queue bucket to transparent.
How do I achieve the effect that these beams and other transparent meshes do not cancel each other, so I could display many such beams? I have experimented with blend modes and render buckets, but it did not change anything, some beams still cancel others.
I would appreciate an advice on this, since I am certainly sure that this is somehow possible because games like Homeworld handle hundreds of such beams, starship trails and other transparent entities on screen. The original Homeworld had even managed to do it in year 1999.
It worked! Thank you very much! Turning off depth write was the way to go! Plus I set the additive alpha blend mode as per your advise. With the additive move, the beams look much better than with other settings.
For now I’ve set the bucket to be the transparent one because I have some 3D GUI elements that have to be over anything, even the beams. But later, I think, I’ll experiment with moving the GUI to a dedicated viewport for this.
Yeah, the GUI is like normal objects within the scene. I am still not sure if that’s a good option, but it will require more experimentation to decide upon it. It’d be cool to have 3D GUI elements in the game.
Hehe, I’ve already linked Lemur to the project and did some experiments with it. I plan to use it for the windows-and-buttons part of GUI. And that also brings us to the next question Lemur texts and fonts (Lemur + JME-TTF ?)