I need a way to create 10,000 instances of the same mesh and add a component witch rotate teach of them (so the engine should check each component update) without freezing UDK.
I was testing Godot, Cryengine and Unigine with a basic scene composed of 100 X 100 instances of a 546 polygons mesh, each of then has a script/component attached, so at start the'll get a float speed between 0.05 and 0.20 and on every frame they will rotate on Z axys the speed multiplier. The scene also has a directional light with shadows, and a camera that move up.
This is what i'm doing on UDK. I have a component (SceneSetup) that spawn instances of MyClassActor
for (float y = 0; y < height; y++)
for (float x = 0; x < width; x++) {
auto item = GetWorld()->SpawnActor(MyClassActor::StaticClass() );
// then change position
}
And MyClassActor Constructor atach to himself a StaticMeshComponent and a CustomRotationComponent
static ConstructorHelpers::FObjectFinder<UStaticMesh> model(TEXT("/Game/MyActorMesh"));
// i think it is copying a new mesh everytime
UStaticMeshComponent* comp = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("VisualRepresentation"));
comp->SetupAttachment(RootComponent);
comp->SetStaticMesh(model.Object);
// then add the other component, and set the speed
On Godot (gdscript) i get 27-30 FPS
on Unigine (c#) between 60-78 FPS
Unreal just Freeze.
I was testing Godot, Cryengine and Unigine with a basic scene composed of 100 X 100 instances of a 546 polygons mesh, each of then has a script/component attached, so at start the'll get a float speed between 0.05 and 0.20 and on every frame they will rotate on Z axys the speed multiplier. The scene also has a directional light with shadows, and a camera that move up.
This is what i'm doing on UDK. I have a component (SceneSetup) that spawn instances of MyClassActor
for (float y = 0; y < height; y++)
for (float x = 0; x < width; x++) {
auto item = GetWorld()->SpawnActor(MyClassActor::StaticClass() );
// then change position
}
And MyClassActor Constructor atach to himself a StaticMeshComponent and a CustomRotationComponent
static ConstructorHelpers::FObjectFinder<UStaticMesh> model(TEXT("/Game/MyActorMesh"));
// i think it is copying a new mesh everytime
UStaticMeshComponent* comp = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("VisualRepresentation"));
comp->SetupAttachment(RootComponent);
comp->SetStaticMesh(model.Object);
// then add the other component, and set the speed
On Godot (gdscript) i get 27-30 FPS
on Unigine (c#) between 60-78 FPS
Unreal just Freeze.
Comment