Search Unity

Question How to Render Lots of Meshes in Edit Mode with Graphics.DrawMeshInstanced?

Discussion in 'General Graphics' started by richard-firehose, Aug 29, 2022.

  1. richard-firehose


    May 31, 2019
    Hey All,

    I've got a game objectless set up for streaming in the props in my game, and am trying to devise a clean solution to rendering them in edit mode.

    I was trying to set up a system that used Graphics.DrawMeshInstanced to render batches of them (for grass and things the count can reach like 20k of the same item at once). However from what I can tell, this is both incredibly slow and seemingly impossible to make consistent. DrawMeshInstanced seems to render the objects for a split second and then the meshes disappear even if a new frame of the scene view hasn't been rendered.

    I saw a few various old posts on how to accomplish this, but none of these solutions seem to work in Unity 2020.3. Does anyone here know of a good way to render batches of meshes in the scene view during edit mode? I'd really like to avoid managing pools of each prop in edit mode.