- Edited
EDIT: I have left the forum for now. Godot doesn't seem to be for me just yet. Will check the engine later, because it does have a lot of really nice aspects. I will not be reading any more answers, but do not see a way to lock the post. Perhaps others find it relevant.
I need to render a lot of "particles" as part of a fluid dynamics simulation and since you can (apparently?) not control the motion of individual particles with a particle system, I tried making a simple test using Sprite3D. On a high end gaming system, I can get 8FPS rendering 10000 sprites, which is entirely useless. Tested this in a windows desktop 64 bit build.
Since I am only just starting out with Godot to check the feasibility of it for my project, it is entirely possible I am doing something silly and that I am the cause for this misserable performance.
The script which does nothing but instantiate the "particles" is attacked below. I made the 3d sprite as a node in the scene, added a spatial material to it and set it to behave like a particle billboard. I turned off cast shadow and double sided. Then I saved the branch (containing just that sprite node) as a scene. That scene is what I am instantiating. I added a single camera to show the sprites.
extends Node
var COUNT=10000
var RANGE=5
var spriteArray=[]
var fps_label;
func _ready():
fps_label=get_node("Label")
for i in range(0,COUNT,1):
var scene = load("res://MySprite.tscn")
var scene_instance = scene.instance()
scene_instance.translate(Vector3(rand_range(-RANGE,RANGE),rand_range(-RANGE,RANGE),0))
spriteArray.append(scene_instance)
scene_instance.set_name("sprite"+str(i))
add_child(scene_instance)
func _process(delta):
fps_label.set_text(str(Engine.get_frames_per_second()))