Hmm, I looked at the source code from where this message originates and it’s triggered when a list of render objects become full. The list can if I read the code correctly hold 1024 values and it has a comment saying “TODO: Should be configurable” Now, I’m not sure what this actually means. @Ragnar_Svensson, @sven or @Mathias_Westerdahl, would you mind shedding some light on this?
Yes, the 1024 limit is currently an upper limit on how many drawcalls are possible. Drawcalls are expensive, so the engine tries to optimise the data where it can, into “batches” of objects that are similar. Here is a link about batching in gui. Although the link is about the gui, the same applies for the game object components too (e.g. sprite and spine).
For instance, the engine is able to batch two or more sprites into one drawcall, if they have the same atlas, and the same material, and no other object is “in between” the sprites, with respect to their z value (i.e. “breaking the batch”). You can monitor the number of drawcalls with the profiler.
So, it should be possible to have that many objects, as long as the engine can batch them into less than 1024 draw calls.
@AGulev: These objects that you spawn, what do they contain?
Maybe increasing the number of materials / render predicates for the different atlases would help with batching? It would mean distinct atlases would have different effective layers however. What does the setup look like?
This sounds reasonable and its such a high number that if someone hits that limit I’d say that it is a very clear indication that something is wrong @AGulev, I’m sure there are things you could do to arrange your visual components in such a way that draw calls are drastically reduced?
Ok, thanks.
It’s a test project (benchmark) for a understanding how it’s works with many atlases and objects.
Just for understanding is engine suitable for a big farm game.
I send this topic to my friend who made this test, I hope it’s help.
WARNING:RENDER: Renderer is out of resources, some objects will not be rendered.
the message is not informative. “Too many drawcalls” - or something like this will be better