Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Batch Instantiate different meshes

Discussion in 'Entity Component System' started by Mephesto_Khaan, Feb 26, 2021.

  1. Mephesto_Khaan

    Mephesto_Khaan

    Joined:
    Jun 2, 2013
    Posts:
    47
    I am trying to populate a large terrain with objects (trees, rocks etc).

    At the moment I am using a single Mesh/Material and give it positions/rotations in a IJobParallelFor.
    But ideally I would like to use different meshes in the best way so I can just populate the Entities in parallel... or whatever is the fastest.

    Any suggestions?
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,574
    Have you tried IJobEntityBatch?
     
    Last edited: Feb 26, 2021
  3. Mephesto_Khaan

    Mephesto_Khaan

    Joined:
    Jun 2, 2013
    Posts:
    47
    Thanks! that looks like a good way forward
     
    Antypodish likes this.
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,574
    Just in a case, you don't fall in the same trap I did, I leave this in here

    In short, you want to keep low batch value.
     
    Ghat-Smith likes this.