Drawing objects using standard blending transparency requires first sorting those objects in order from farthest to nearest. Panda can do this easily when each object is its own Geom. However, once you have called flattenStrong() on the lot of them, they are now all in a single Geom, and must be sent to the graphics card in a single call.
This is, of course, the whole reason for calling flatten: it means fewer independent calls to the graphics card, which translates to faster performance. However, it also means less flexibility on Panda’s part. Once they have flattened, they can no longer be sorted–the sort order is now permanently baked into the vertices. If you are lucky, they will happen to be sorted correctly, but if you are unlucky, they will be sorted incorrectly, and the nearest objects might therefore occlude the farthest objects.
There are several solutions. One is, of course, in this example to avoid the flatten call, and just accept that you have to pay the cost of having individual objects if you wish them to be sorted correctly.
A better solution might be to use a different kind of transparency that doesn’t require sorting. For instance, you might try:
which works perfectly, regardless of the order in which geometry is rendered. However, this transparency mode only supports full-on or full-off pixels; there are no pixels that are 50% alpha. Depending on the effect you’re going for, this may be acceptable.
You might also try:
which is a compromise between MBinary and the default, MAlpha. Some antialiased edges are still occluded, but others will still be OK.
If you have full-screen antialiasing enabled, you might also have luck with MMultisample.