Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extraordinary number of drawcalls with labels contain lots of characters #5838

Closed
sanikoyes opened this issue Jul 21, 2016 · 5 comments
Closed

Comments

@sanikoyes
Copy link
Contributor

sanikoyes commented Jul 21, 2016

Draw an label control with 1000 of characters would be consume more than 1000 draw call(s) in current version of godot engine, every character consume an draw-call, and other control like Sprite9Frame consume 9 draw-calls
perhaps add sprite-batcher optimization for canvas_item draw can fix this problem.

@reduz
Copy link
Member

reduz commented Jul 21, 2016

This number of draw calls is not much of a problem in OpenGL. Batching is not really necesary.
If you are seeing performance issues, it's most likely due to the way Godot draws the characters (it's kinda inefficient).

It needs to be done in a way where setting up array states is more efficient, but this is a little difficult in GLES2. We'll be doing a rewrite of all this after 2.1 is out, so a simple benchmark (drawing a large text?) we can use as reference could be very useful.

@reduz reduz added this to the 3.0 milestone Jul 21, 2016
@Zylann
Copy link
Contributor

Zylann commented Jul 21, 2016

Why is 1000 draw calls not a problem in OpenGL? I remember having frame drops on tablets with only 100 draw calls with a previous project on Unity.

@reduz
Copy link
Member

reduz commented Jul 21, 2016

It depends on how the draw calls are done. In Godot (for 2D) they should be
fairly cheap.

There is also another problem with text, which is that font textures are
generated on the fly if you use DynamicFont. If characters come from
different textures, there is no possibility of batching them. I still think
this is something that should be easy to optimize in 3.0, so some sort of
demo would be very appreciate.

On Thu, Jul 21, 2016 at 6:36 PM, Marc notifications@github.com wrote:

Why is 1000 draw calls not a problem in OpenGL? I remember having frame
drops on tablets with only 100 draw calls with a previous project on Unity.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#5838 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-Z2yY8rWwbhKlTtrQzWb77aQ-LfsGKks5qX-ZagaJpZM4JRxDJ
.

@reduz
Copy link
Member

reduz commented Aug 5, 2017

This should not be a problem in the GLES3 renderer anymore, but it's difficult to fix for a GLES2 backend (as many phones need this). I will leave it open but might be better to eventually wait for phones to get better than fixing this.

@akien-mga
Copy link
Member

#19917 is a more recent duplicate, but it has more discussion and details, so I'll close this issue as duplicate of #19917.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants