-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Text rendering performance low due to missing batching #19917
Comments
@akien-mga I don't think this problem is only for Android. It is more obviously on Android as it can't reach 60 FPS. |
2D doesn't batch anything so each character is a draw call. It looks like you are working on an app so enabling low processor mode would make it only render when needed. |
Been discussing for a while the idea of batching text, which is also needed
for other stuff such as drawing text outlines
…On Mon, Jul 2, 2018 at 2:28 PM Geequlim ***@***.***> wrote:
*Godot version:*
Godot 3.1 compiled with 54988df
<54988df>
*OS/device including version:*
Android 7.1.2
Qualcomm® Adreno™ 430 GPU OpenGL ES 3.1
*Issue description:*
Text rendering harms the FPS on Android with GLES3.
In the screenshots below the same scene rendered with diffrent text
content.
More text rendered less FPS.
[image: screenshot-1530551860525]
<https://user-images.githubusercontent.com/6964556/42177581-ceaa8fd4-7e5f-11e8-8645-c76a087a1e3a.jpg>
[image: screenshot-1530551712802]
<https://user-images.githubusercontent.com/6964556/42177594-daba4cba-7e5f-11e8-91a7-01b8df5883eb.jpg>
*Steps to reproduce:*
- Create a RichTextLabel and fill a long text as its text
- Export and run it on Android with GLES3
*Minimal reproduction project:*
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#19917>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AF-Z24mQHDJim8J0pn1hlZFZKjPIU9VMks5uClhRgaJpZM4U_rel>
.
|
@akien-mga Of couse yes |
@dragmz You can download this project for testing |
Thanks @Geequlim Here are my first results for GLES2: (batching vs master FPS with given number of "Add More Text" 1024k RAM vertex bufferEmpty: no change 10024k buffer100: 250 FPS That's on Intel GPU. I should be able to test on Android but that may take me a few days. |
@akien-mga did we not merge a new batching afterwards? |
No, #20965 was the "new" batching (the previous one was never merged, it was rejected). |
Hold my beer! 😎 This is the result of my new batching (PR coming soon) with the text_rendering.zip test project posted above, in GLES 2 on desktop (similar gains on Android though): I rigged it so that each press added 100 lots of the text instead of 1 (I'm guessing this is what dragmz was doing). Debug buildGodot 3.2No clicks 1560 fps Godot 3.2 + new batchingNo clicks 2050 fps Sorry had a methodology error in my first set of figures, these should be more accurate. Note these are both for debug builds. Edit - I've now done a test with release build and a few more tweaks. As I suspected, the speed gains in release are even higher: Release_DebugGodot 3.2500 clicks 5fps Godot 3.2 + new batching500 clicks 291fps (58x speed increase) This is on Intel Core i5-7500T CPU |
What are the steps to get this working for gles3? Although it is going away... |
Although the interesting thing is the rich text should probably cull away the text that isn't on screen, and if this were working, there would in theory be no performance drops after about the 8th click. Still kind of useful as a benchmark. |
Looks pretty simple actually, that part of the renderer is pretty similar, almost a copy and paste job. |
I and others who use 2d menus in 3d games on mobile gles3 would very appreciate this! I hope it isn't too hard to do in the same pr. Thanks. |
Meanwhile You can use FastText asset. It is a little workaround I did for my projects and it works perfeclty on both Android and desktop. No watchable frame drops for 1000 FastText labels stress test. |
Can now test my batching PR on Android, debug build, same test as before, on a Google Nexus 7 2012: Godot 3.2 without batching0: 60fps Godot 3.2 with batching0: 60fps That's 5.3x speedup. |
Good, but if it is an engine builtin text batching, my newbie opinion is that it could be improved: look at this custom GDscript text batching running on Android video
|
You are absolutely right, if you mean caching the text as an image. However this isn't what these batching PRs do, they are lower level and intended to accelerate all rects (and eventually all primitives), and letters are still ultimately drawn one at a time. They aren't specifically to address text rendering. There could be an argument to add the caching you suggest in core (many GUI systems do this for text and other elements), you could propose it on godot proposals (if it is not there)? 😊 |
Oh well, I told you I am a newbie 😄 Infact I understood wrong 💭 |
This should have been closed when #37349 was merged. |
Godot version:
Godot 3.1 compiled with 54988df
OS/device including version:
Android 7.1.2
Qualcomm® Adreno™ 430 GPU OpenGL ES 3.1
Issue description:
Text rendering harms the FPS on Android with GLES3.
In the screenshots below the same scene rendered with diffrent text content.
More text rendered less FPS.
Steps to reproduce:
Minimal reproduction project:
The text was updated successfully, but these errors were encountered: