I have a dynamic mesh, so every frame I must update the vertices and indices.
I populate a FloatArray with the new vertices and then when flushing the array, if I call
mesh.setVertices(finalMesh.array());
everything works fine, however there’s a performance hit since my finalMesh float buffer can vary in size and I don’t want to flush the whole array everytime.
So I tried doing a
mesh.setVertices(finalMesh.array(), 0, finalMesh.position());
Which works ok on my desktop.
However on Android However in some other computers/devices with this setup, it shows a lot of garbage on the screen.
I tested with my Mac (no problems), Android Moto G (problems) and windows (problems)
Any ideas on how to avoid that ? Or it’s the safest bet just to flush the whole array every frame?