Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Basic static batching question

Discussion in 'Getting Started' started by Samhayne, Mar 18, 2019.

  1. Samhayne


    Jun 15, 2009
    Hi guys,

    unfortunately I find the static batching documentation very... sparse,
    so I went here in hope to find an answer. :)

    My problem is: How to control which static objects' meshes are merged together?

    I have a game with an isometric view and I mark two houses in my town as static (including their children).
    One is in my town's center and the other one at the edge of the town - you'll never see them together.
    But Unity merges their meshes together, so if I see one, both are drawn (?).

    How can I control this and say: Merge this group A consisting of gameobjects 1,2,3
    and merge this group B consisting of gameobjects 4,5,6 and please don't mix them?

    edit: Okay, after some browsing I found an interesting posting by bgolus here, where he explains that in fact every mesh renderer of a static object just draws defined triangle index ranges within the big merged mesh.
    Still puzzled how to control things a bit better - in my case I do some DrawMesh() calls for post processing but I don't want to draw the entire merged mesh of course.
    Last edited: Mar 19, 2019