-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Sprite rendering performance regression #24466
Comments
It's either this or nvidia bugs, so pick your poison. |
I can imagine batching will improve performance again, but not a lot more can be done. |
if it can be done well, fine |
Considering most games aim for 60fps (and more importantly most physics implementations - 2D as well as 3D - nowadays target 60fps), is it really that important? |
yes. it's pretty laggy on phone with gles2 now even simple scene. |
I can have a look into batching again when the GLES2 implementation is feature-complete. |
@dragmz GLES2 is now finally feature complete (At least 2D) |
@dragmz any good news? |
Apologies, but at this rate this will have to be kicked to 3.2. As soon as anyone can contribute batching support, will be glad to merge it. Otherwise, I will have to do it myself sometime after 3.1 is out (and likely after Vulkan back-end is implemented). What I can offer is to undo the workaround only for mobile, which should increase performance a bit. The fact we are still so low on rendering contributors is still a problem, will need to find a way to tackle this problem after 3.1 is out. |
@volzhs @reduz I've been doing some initial tests with a very scope-limited draw calls batching but that does not increase performance much for the use cases I'm mostly interested in (e.g. drawing sprites or polygons). My previous experiments show that what the GLES2 renderer lacks is buffer updates batching (i.e. glBufferSubData) . This has been pull requested and rejected in #20077 and at the moment I don't have any new idea on how to reimplement to get it accepted. |
I hope you find a way. |
@volzhs: It used to be the case that every letter drawn in gui controls was a draw call. Not sure if it's still an issue because one of the batching attempts closed it and I don't think it was reopened, but it might be the case still. |
@Zireael07 It's still a case because #20965 that batched the draw calls has been reverted with #21204 |
This is an issue for us on an android app that shows a lot of text, running on KitKat. Any pointers or hints on how to implement this ourselves? |
6d8083e should solve this issue on OpenGL ES2/WebGL 1 platforms, but restricting the new rendering path to OpenGL 2.1 (since it's only meant to work around Nvidia driver issues, so only relevant on desktop). For desktop platforms, it would be good to have some metrics of how big the performance difference is on some projects like the platformer 2D, some GUI-heavy demos, etc. You can test locally by compiling current master to test the "after" performance, then revert 6d8083e and bec76cf and compile again to test the "before" performance. Or instead of reverting, you can edit
#if 0 .
Please mention OS, GPU, drivers and the projects tested with the before/after framerate. |
Some test results: "After" state: f4ac678 unmodified (i.e. the Nvidia hack for #9913) Linux x86_64, Nvidia GTX 670MX with drivers 410.93. Drivers Vsync off for testing. Running the demos in fullscreen with I also put GLES3 results for comparison. Testing demos from https://github.com/godotengine/godot-demo-projects, commit 916c9c9. Note: This are quick tests on one single configuration and should be taken with a pinch of salt, yet they should some trend.
Before: 550 FPS (506 to 565)
Before: 637 (608 to 650)
Before: 1037 (1017 to 1043)
Before: 810 (764 to 825)
Before: 881 (846 to 892) https://github.com/KOBUGE-Games/jetpaca, branch Before: 555 (552 to 563) Those are simple tests, and different configurations might show different results, but to
I'd definitely pick the Nvidia bugs kind of poison over a ~50% performance regression, or more for text. |
It has a big impact on 2D and text rendering performance (cf. godotengine#24466) so the solution seems worse than the bug it aims to work around. It's now opt-in via "rendering/quality/2d/gles2_use_nvidia_rect_flicker_workaround" for those who need it and have a simple enough game for the performance drop not to be an issue. Fixes godotengine#24466.
Yes this made my app usable on android again. Increased the FPS around 5 times |
It has a big impact on 2D and text rendering performance (cf. godotengine#24466) so the solution seems worse than the bug it aims to work around. It's now opt-in via "rendering/quality/2d/gles2_use_nvidia_rect_flicker_workaround" for those who need it and have a simple enough game for the performance drop not to be an issue. Fixes godotengine#24466.
Introduced with bec76cf
The change (i.e. not using the static quad buffer) makes sprite rendering slower. See the project attached to #19943, i.e. polygon2d_performance.zip. Just make sure to use the GLES2 renderer.
For me it's 110 vs 350 FPS on a release_debug build for "Sprite x1" mode when running the project on Intel 4600.
The text was updated successfully, but these errors were encountered: