I’ve been reading around the forum and the website about batchnode and instancednode, specially from these links:
But I don’t find clear enough which of them should I use for my case and also exactly how to do it. The part of the scene I would like to batch/instance has around 50 geometries of 6 different models using 2 different materials.
I tried both and I didn’t get the desired results, in both cases framerate dropped between 20-30% and the counters of the statsview remained more less the same (which from my point of view should have been lowered based on information at https://wiki.jmonkeyengine.org/jme3/advanced/statsview.html). So I think either I didn’t undertand anything correctly or I’m not using this feature in the correct way.
In both cases, I’m adding all ~50 nodes/geometries to the same node and call batch() or instance() afterwards. This node is child of the root node of the scene. More less the same way the tests in the jmeTest project are done.
I don’t know if this is the correct way of doing this, specially for instancing after reading the comment of the linked post from momoko_fan:
“Yes the mesh instances have to be the same for instancing to work. Material instances also have to be the same for objects to be instanced together. This doesn’t mean instancing will break or anything, just that you won’t see any performance improvement if all objects are completely different.”
That makes me think if I would need to create one InstancedNode for each different geometry or the instance() method is smart enough to group them.
In adition to that, my project is for android, although most of my testing is done in the PC. I don’t think that instancing is supported on android as having a look at the jme3-core code only GL_ARB instancing extensions are checked in the GLRenderer but GL_EXT extensions are not checked that would be the proper extensions for GLES 2.0 (https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_draw_instanced.txt) and also GLES 3.0 is not used and instancing is a core feature in that version and onwards (https://www.khronos.org/registry/OpenGL/specs/es/3.0/es_spec_3.0.pdf)
Any advice is welcome Thanks!!