Things are rather slow

Hello!



While watching some demos from the website of jME I was happy to see a high fps in the scenes with around 50k of vertices.



And because my app runs 9k of vertices with about 18-20 fps I believe I am doing something wrong.



Here's how I do things.



I have a custom made class, that describes a quad that consists from 2 triangles. There are 2048 of that kind of quads in my app. Then from this quad a TriMesh is being made and each that TriMesh is being added to the scene manager with rootNode.attachChild(TriMesh). Finally it looks like this:




Don't ask why I am drawing that, I just need :)

There's something inside me that tells me that I shouldn't add 2048 nodes to the scene manager that directly :)

Is it right?

Yes, every object brings additional overhead. And adding them "flat" to the rootNode adds even more overhead (for example, all have to be culled individually).

what he is saying is:



add six nodes to your node (each representing a side of the cube) then add the triangles to the appropriate cubes. Most importantly, you should lock() the rootNode afterwards.



OR



you can have all the triangles you want in one single Geometry. Changing a specific triangle will be more difficult then, but it will be MUCH faster.

Have a look at geometry instancing. That will reduce your batch-count to 1 and speed up everything a lot.

also try using display lists -> node.lock()

Core-Dump said:

also try using display lists -> node.lock()

That helped a bit.

I think I will focus on joining quads onto solid geometry.

Thanks for your help!