Is it possible to increase the render object count?

I dynamically create and delete gui nodes in my project but after some I get the message
WARNING:RENDER: Fontrenderer: Render object count reached limit (128)
How do I fix this please?

1 Like

Currently, it’s not possible to configure this setting.

128 draw calls for the text is fairly large though, perhaps you can explain a bit more about your use case?

In order to display options to the player, box and texts nodes are dynamically created to represent those options. Not all the options can fit, so in order to display the next batch of options the active nodes are deleted and the next batch of options are also created dynamically.

But texts would generally be batched internally (in order to save number draw calls).
Is this a gui text or gameobject label?
Are you setting any special properties to the texts?

1 Like

Sorry for the late reply. It is a gui text and there are no special properties.

1 Like

Are you assigning layers to the text or is the text it interleaved with box nodes without any layers assigned (in which case the draw calls will increase dramatically).

2 Likes

There are no layers.

Ok, that could be a problem if you mix box and text nodes. My suggestion is to create two layers in your gui, name them “text” and “box”.

Use gui.set_layer(some_text_node, “text”) and gui.set_layer(some_box_node, “box”).

Make sure to also read up on layers in the manual to understand how they work:

2 Likes

Thanks a lot for your help.

1 Like

I’m having the same problem, using LABELS inside Game Objects.

If I was using GUI I would be setting up layers to fix the issue.
How do to when dealing with labels within game objects?

If the labels are on the same Z value, using the same material/font, and they have the same render constants, then they should batch together into a single draw call.

2 Likes

Batch rules for non GUI is documented here: https://defold.com/manuals/render/#batch-rules-for-non-gui-components