Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  6. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Culling in MeshInstanceRendererSystem

Discussion in 'Entity Component System and C# Job system' started by Sylmerria, Dec 1, 2018.

  1. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    161
    Hey guys,

    I have tried to stress test and to understand MeshInstanceRendererSystem.
    I drew an isometric map of 650K tiles without GPU instancing because of a crash :( (Case 1105764).
    I set my camera to see only 700 tiles and so 700 drawcalls without batches

    But I noticed that MeshInstanceRendererSystem draws 650K sprites via :


    (That comes from a build)

    So do I need to set LOD to discard rendering far from camera or I need to control which entity has to be drew or Unity team will add a culling system or how do you do ?

    Thanks :)
     
  2. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    686
    Last edited: Dec 1, 2018
  3. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    161
    So for resum how works culling in ECS from this thread and source code :

    If you want culling happens, entity needs a MeshRenderBounds, LocalToWorld( added by TransformSystem if your entity has a Position or Rotation or Scale component) and a WorldMeshRenderBounds. See MeshRenderBoundsUpdateSystem

    Set your WorldMeshRenderBounds with world position center and radius of entity.
    Your WorldMeshRenderBounds needs to be updated manually each time entity position is changed.

    Tip : you can boost culling performance if you successful group close entities in same chunk.


    @eizenhorn My bad and my shame because I begun to look Culling because of this thread and your first video but I have not see the final answer :oops:
     
    Last edited: Dec 4, 2018
    meanmonkey likes this.
  4. meanmonkey

    meanmonkey

    Joined:
    Nov 13, 2014
    Posts:
    85
    thanks, your conclusion was very helpful for me
     
    Sylmerria likes this.