Strange things happening in space!

I find that for rendering glowing particle effects, the best solution is to use additive blending, depth test enabled, depth write disabled, rendered last:

nodePath.setAttrib(ColorBlendAttrib.make(ColorBlendAttrib.MAdd))
nodePath.setDepthTest(1)
nodePath.setDepthWrite(0)
nodePath.setBin(‘glowingStuffBin’, 0)

Where glowingStuffBin is after the bin you use for regular transparent rendering. So let me explain what this does. Panda’s transparency attrib turns on alpha-blending. Alpha blending blends the polygon into the framebuffer using this formula:

result = polygon_color * alpha + framebuffer_color * (1-alpha)

Instead, my code uses additive blending:

result = polygon_color + framebuffer_color

In other words, the polygon just makes the framebuffer brighter, never darker. This is absolutely perfect for bright glowing particles. Better yet, addition is commutative, so it doesn’t matter what order the glowing particles are rendered: you don’t have to depth-sort them relative to each other.

Finally: turning off depth-write ensures that a semi-transparent particle doesn’t hide the other semi-transparent particles behind it.