Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Performance] Many Meshes vs Particle System

Discussion in 'Scripting' started by plokkum, Dec 24, 2015.

  1. plokkum

    plokkum

    Joined:
    May 28, 2013
    Posts:
    90
    I'm creating forests in my 32x32km level, which is a polygonal mesh (not terrain). I could place all the objects using a simple editor script and distance cull them. But I could also just create a particle script that places my tree meshes where they need to go.

    Does anybody know if a mesh particle system is easier on the performance than a lot of pre-spawned, culled objects?
     
  2. passerbycmc

    passerbycmc

    Joined:
    Feb 12, 2015
    Posts:
    1,741
    particle system is meant for short lived objects, and has its own overhead. I would just write a script that places the trees for you as prefabs. This would also give you more control since you can write some logic about how to place the trees as well.

    You will need a aggressive loding system as well as occlusion culling on the terrain. Since your terrain is a static mesh it will make sense to divided it up into multiple pieces so the whole terrain dosnt have to be rendering all the time.
     
  3. Nigey

    Nigey

    Joined:
    Sep 29, 2013
    Posts:
    1,129
    That's one of their main suggested 'things to do' for mobile optimisation: http://docs.unity3d.com/Manual/MobileOptimizationScriptingMethods.html.

    Like @passerbycmc suggested. It is specifically designed for certain situations. I'd suggest trying the most simple way, and seeing if it's any problem in the profiler. You don't need to make problems before they come around lol.

    Lastly I'd also suggest you make this into a terrain. Their LOD system is brilliant (although they don't have horizontal billboard trees built in, only vertical), and they're pretty efficient. There's also custom codes on the web to turn your static meshes into terrains and back again.
     
  4. plokkum

    plokkum

    Joined:
    May 28, 2013
    Posts:
    90
    The good thing about my terrain is that it is ultra low-poly :) Which is why I chose a mesh over a terrain. My trees will also be very low poly (about 8 polygons each). So that doesn't need a LOD-system in this case either. But I guess it might just be easier to create a spawn script to populate certain areas, and just throw them all in my culling layer.

    Thanks for the clarification, guys! That helps a lot!
     
  5. Nigey

    Nigey

    Joined:
    Sep 29, 2013
    Posts:
    1,129
    No worries. Don't forget to check out that link I threw you. It does talk about using particle system's instead of many many gameobjects..