After setting the ray limit the performance improved substantially so I think it was in fact the real cause. Bullets are made from two quads (or 3 in the turret case) merged together into one mesh and one material which are both static and reused so they shouldn't be repeated in gpu memory.
I haven't looked into the real instantiation via InstancedNode/Geometry yet but that ought to bring some extra performance in the future.
I do it in jme so yes, it's kind of wasteful but at the moment it's quick enough for an absolute shitstorm of projectiles. Mileage may vary with the amount of stuff in the scene of course.
Raycasting in bullet would be a lot faster since the ship collision shapes are made out of an optimized number of boxes but that gives me another problem. Bullet would only tell me that the ray hit the ship and where but not which geometry got hit since i only get the ship node in the listener. Then I need to do a secondary check to determine the geometry itself which is innacurate (so it's fast enough) and I only use it for splash weapons that shoot actual physics objects.
Funny thing though, the projectiles from the old plasma cannons are physics spheres which are an absolute hog on performance so that's not exactly a good sign for bullet. Those are getting converted to raycast soon.
There's another problem and that is that I'm still on Jbullet instead of native so the speedup won't be that high I bet. Maybe one day in the future years when the half done port that is native bullet gets into a proper working order with all the features that jbullet has.
Nope, but I have a think that it would have next to no effect because of some internal optimizations that are unknown to me but I can feel them when playing. Like there's a noticeable performance difference between shooting at a ship and like 30 degrees away from it (with a super large swarm of bullets). It's like some geometries do a rough distance check and return 0 before actually checking any triangles.
In my experience, using billboards is a huge mistake. In time the cpu will take to orient the quad the gpu can render so much more. Using two quads in a X position + one facing the rear/front merged into one mesh performs much better. Especially if the mesh is instantiated.
Also, axis alligned billboard shots tend to look like absolute crap from behind, which is the exact way the player looks at them for most of the time.
I'd have to really deconstruct the emitter for this though. The local and world space simualtions aren't right for my setup and I'd somehow need to figure out how to create large custom meshes from 3 quads per piece, keep track of those pieces in a mesh somehow and make them interact with the world....
I have better things to do for the next year and a half that this would take to fully figure out. Especially with the easy alternative to simply lower the fire rate a bit and buff damage.