Hi guys, I faced an issue with profiling my game. I’m creating a simple mobile game with a lot of objects, each object has about 20 vertices and I have about 600 objects in the scene on my Mac it works fine, but on the phone, the game takes about 20-30ms to draw a frame and it looks freezing.
In the built-in profiler, I can see that these objects take about 4ms for an update, but the update method for these objects is empty, it really strange for me.
Script.update@/main/entities/obj.script 3.36 600
RenderScript.UpdateRSI 5.51
Also, I run the game with profile UI enabled and I see that top of slow methods are:
clear screen - up to 10ms (I do it twice per frame)
draw render list - up to 15-20ms
setvertexbufferdata - 10ms
renderbatch - 5ms
renderbatchworld - 5ms
resources:
ModelVertexBuffer - 13217280
DrawCalls - 43
The question is why it takes so much time to draw 600 simple objects, they are in the same collection proxy, the same model, the same material and I do not pass any shader constants per object, only on init I use the same tint for each object. And why I have so much draw calls?