godot: Sprite3D and AnimatedSprite3D is rendering very slow
I tried so much variations with/without shading with gdScript, nativeScript (Nim) and different import settings without luck. One archer walk animation, with 8 frame costs 14 fps (reduced to 46fps) . It slows to 19-20fps when I exported it to android also. I’m adding screen shots from my computer with GeForce 940MX screen card (I can play Anno 1404 without any lag with this screen card).
I have only one
archer on the screen, and I scripted with nim (very fast programming language). I supposed in this example I made the fastest things I can do. If not please share my mistake.
Version: Godot 3.0 System: Linux Manjaro (ArchLinux derive) Frame rate drops too much (14fps for only one node). I expect it to work with 60fps.
Screen shots:
I have only one scene as Archer and I’m using a sprite image only. Nothing more.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 7
- Comments: 22 (15 by maintainers)
Commits related to this issue
- Document known performance issues with Sprite3D See https://github.com/godotengine/godot/issues/20855. — committed to Calinou/godot by Calinou 4 years ago
- Document known performance issues with Sprite3D See https://github.com/godotengine/godot/issues/20855. (cherry picked from commit 92fa3e076fa5442ef410996509eb7514d3372da1) — committed to akien-mga/godot by Calinou 4 years ago
Fixed by #39867 in the
3.2
branch.It’s not fixed in
master
yet though, so keeping this issue open. A different fix will be used there.I’m going to just replace the backend of the Sprite3D with a proper mesh instead of using ImmediateGeometry.
I can only draw about 100 Sprite3D before i drop below 100fps, but i can draw almost 1000 QuadMesh.
@clayjohn What about AnimatedSprite3D? It’s surely possible to emulate its functionality using a MeshInstance + QuadMesh, but it sounds tedious to set up.
Does Sprite3D need a refactor? Surely an object that simple should not be so slow to render.
This was resolved for
master
by https://github.com/godotengine/godot/pull/50014, closing.To confirm this, I benchmarked
3.x
againstmaster
to compare the current rendering performance of 900 Sprite3Ds in a blank scene (no lights, fallback environment).Benchmark
OS: Fedora 34 CPU: Intel Core i7-6700K GPU: GeForce GTX 1080 Resolution: 2560×1440 Godot versions:
3.x
a05aefb74,master
fe6c65a1aTesting projects:
3.x
: test_sprite3d_performance_3.x.zipmaster
: test_sprite3d_performance_master.zipmaster
- Vulkan Clusteredmaster
- Vulkan MobileRuns faster than Vulkan Clustered thanks to its lower base cost. However, its performance will fall behind compared to Vulkan Clustered in a more complex scene with many lights.
3.x
- GLES33.x
- GLES2Despite the GLES2 renderer’s lowest base cost (out of all the renderers tested here), this is by far the slowest result.
@semirix it should probably just be removed and made into a thin shell for a billboarded quad.
PR is up now! Please test it if you are having performance issues with Sprite3D!
#39867
See my comment above yours: https://github.com/godotengine/godot/issues/20855#issuecomment-654278054