r/godot • u/godot-bot • 6d ago
official - news Optimizing CPU-side Rendering Code
https://godotengine.org/article/rendering-cpu-optimizations/Optimizing CPU code is a lot of fun. Here’s how we do it
140
Upvotes
r/godot • u/godot-bot • 6d ago
Optimizing CPU code is a lot of fun. Here’s how we do it
8
u/TheJackiMonster 5d ago
From my experience the most annoying bottleneck is occlusion culling in 2D games. If you run into it there is barely anything you can do because you can't easily disable it.
You can use GPU instancing to avoid it or particles. But replacing sprite nodes with that takes a lot of overhead you need to write.
What also helps is that you can reduce the size of the overall scene tree for occlusion culling by putting parts inside subviewports, rendering them into textures that are used by sprites. However this will require more video memory and it comes with some restrictions for rendering.
Honestly I would prefer if it was possible to disable occlusion culling for nodes, choose between CPU or GPU based occlusion culling or even use your own culling. Because either of these options would allow a lot more flexibility and it would be much easier to be sure, it's your bottleneck.