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

I encountered a strange situation when migrating a project to version 1.9.3.
On the previous version (1.7.0) there were no warnings from fontrenderer.
Text nodes are placed on a separate layer, so everything is fine.

However, when i migrated to version 1.9.3, i got warning from fontrenderer: Fontrenderer: Render object count reached limit (128)

However, there are few text nodes on the screen:


If you count them on the screenshot, there are only about 90 different text nodes.
But not 128!
And like i said, the text is on layers. So there is no way that EVERY node is still rendered individually.
There’s obviously something wrong here!

Can you replicate this in a project you can share here (or in an issue on GitHub)?

Yes, i will try to make a repo case in the next few days.
When i unchecked Stencil Visible from all stencil nodes, the warnings stopped appearing… O___O
But even with these warrnings, there was not a single lost letter of text - everything was output the same as without them.

Clipping will impact batching of gui nodes, but I’m not sure if it perfectly explains your situation

1 Like