This is a sign that your scene is completely messed up. That’s why we recommend a smaller number because usually the people who want to render 5000 objects (ie: 5000 separate draw dispatch round trips to the GPU per frame) have done something very wrong.
While the code in the tutorial is fine, it cannot be used to create this amount of lines. Apparently the author never thought of creating more than a dozen of lines, so he did not over-optimise it for clarity. If you are to create hundreds of lines, then the best way would be to put them all into a single Geometry and use a single material. You can modify the Geometrys vertex position buffer to manipulate the lines. I would suggest you to look at the custom mesh tutorial and examine the code of ParticleEmitter.
Depends on your needs. If you want a more wireframe-like behavior, you can use one of the Line* modes. Or you could just go with quads and use the standard Triangles mode (a quad is made of 2 triangles). If you need help understanding any of these, please read the correcponsing OpenGL documentation papers like here or here.
Well, I changed the point meshes to standard box meshes.
The number of objects decreased, but FPS remained unchanged. For sure on every
rendering batching is performed, so this poor performance (only 600 objects cannot take much CPU time).
I also tried to use the unpacked meshes instead “optimized” , this is do nothing. But in other scene with extreme count of objects 200 000 I got better performance during batching.
Other scene (batching on):
Geometry box = new Geometry("Box" + i, new Box(Vector3f.ZERO, 1, 1, 1));
Geometry box1 = new Geometry ();
Mesh boxmesh =new Mesh();
Sorry, in the second test “box1” had static position. Truly fps the same.
Also, the addition of four materials of boxes take up fps, but have freezing.
Truly on every frame batching is performed, and take of many CPU cycles.