Search Unity

Question Optimising many procedurally generated meshes from database

Discussion in 'General Graphics' started by abenfante97, May 31, 2023.

  1. abenfante97

    abenfante97

    Joined:
    May 31, 2020
    Posts:
    1
    Hi! I am building an app that procedurally generates building meshes from the database of a big city, at the moment extruding them in real time up to a certain distance from the user, and I need to make it compatibile with VR hardware (HTC vive) on a high-end machine, so 90 fps at high resolution is a must.
    I wish to implement LOD or some kind of impostors so that the horizon never looks bare because of unrendered buildings, because the city is mostly flat. What is the best approach to render all of this?
    I chose not to use ECS because entities graphics is not compatible with VR yet.
    At the moment I am istancing each building in is own gameobject at a controlled rate to not cause slow-downs, while using a pool of gameobjects to avoid creating garbage.
    While this approach has given me decent results while nailing down the mesh generation, I know it's far from optimal, especially when I will need to add further load on the cpu and gpu by adding (mostly untextured) better graphics and interactions.
    Luckily, the cost of generating meshes from the data at the moment is not a limiting factor, so now I want to focus on the graphics optimization. I am looking for advice on that, because I'm unexperienced in it.
    Should I follow a particular strategy to leverage the rendering features in this particular case, or should I just start shaving off costs here and there looking at singular aspects?
    What do you expect to be the main issue in building this?
    At the moment I'm working in URP because it seemed the most flexible and fit to render simple graphics, do you think is it a good choice? Is it even very relevant?
    Thank you, I hope this is a pertinent post.

    Pic: the current look of the procedurall generated meshes
    Immagine 2023-05-31 190946.png