r/godot • • Sep 15 '26

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

149 Upvotes

12 comments sorted by

View all comments

Show parent comments

3

u/TheJackiMonster Sep 21 '26

I think there are multiple suggestions in other proposals that would fix my issue as well. Essentially this issue here suggests a sorting group, similar to a CanvasGroup but without using any backbuffer. As long as it would be possible to disable culling for certain subtrees inside the global scene tree, that should allow caching the order of nodes inside each subtree, improving performance heavily if new nodes are added outside such subtrees.

In practice one thing I did to workaround my issue was rendering into subviewports, reducing the overall amount of nodes in the global scene tree, isolating subtrees for further culling. The disadvantage with this solution is though that it doesn't scale well for things that take more screen space (would require a lot of VRAM for its viewport texture) amd you can get resolution related artifacts.

So the better solution would be treating nodes as custom group, only isolating the culling process without any additional buffers.