Using Godot 3.4.4 - GLES3
Hi all, I have a tree scene that I'm instancing with the below code which is performing really poorly when the instances are being rendered:
func load_instance(in_name):
if !in_name in nodes:
nodes[in_name] = load("res://scene/"+in_name+".tscn")
return nodes[in_name].instance()
I then use main.scene.add_child()
with the result of this. main.scene
just being a reference to the main scene.
I've confirmed that this is indeed not loading the tree more than once and the loading performance itself is perfect.
However, if I look in the other direction at the same scene that I have manually duplicated many more times in the editor it is performing significantly better (first pic is the gdscript instanced ones, other is the editor-duplicated ones). It's the same scene using the same material in both instances.
There is no collision shape or anything else being added to the scene in either case. The tree itself is just two meshes with a material on each. However, I have also tried this with plain meshes (cubes and plains) and I see the same result.
Any ideas why the gdscript instanced scenes are running slowly? I've included the monitor output in the screenshots.