Instanced Static Mesh Component AddInstance performaces issue

Hi,

I’m working on a simple voxel engine for research purposes and for UE4 Learning.
I’ve some experience with other game engines like Unity.

Try to ask my question per points:

  • In my prototype, basically, we would to create the entire world procedurally via Perlin Noise functions, in some way.
  • The world is subdivided by chunks of 16x16x16 blocks
  • At each frame, the engine compute the chunks to spawn, generate it in terms of blocks, create a “InstancedStaticMeshComponent” dinamically and attach it to the Chunk (a simple SceneComponent).
  • For each ISMC created, add all blocks

So the Actor’s hierarchy is:

Actor (World)

|--Chunk1 (SceneComponent)

|------ISMC (filled with an instance per block)

|--Chunk1 (SceneComponent)

|------ISMC (filled with an instance per block)

The world works well, and the engine generate it correctly in front of the Player.

My problem is about performances. Each time I add blocks (instances) to the chunk (ISMC), 16x16x16 = 4096 instances, there is an Hitch. I can try to work on chunk visibility optimization, but the spawn of a single chunk create an hitch, so I believe something escapes me.

I’ve checked the Engine code, and somewhere it speacks about Physics, that I absolutely don’t need. May be the ISMC try to work on some physics and I can disable it?

Thanks in advance for any kind of tip you can give me.
Regards,

Hi,

no one played with these things?

I just called SetSimulatePhysics(false) and SetCollisionEnabled(ECollisionEnabled::NoCollision) of the ISM component itself. That seems to disable physics/collision for all the instances.