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

Question Moving runtime static batched objects root

Discussion in 'General Graphics' started by kaiyum, Jul 25, 2022.

  1. kaiyum

    kaiyum

    Joined:
    Nov 25, 2012
    Posts:
    686
    So let's say A, B, C and D all are meshes under(all fours are child of) "RB". Now I statically batched A, B, C and D with the following code:
    Code (CSharp):
    1. StaticBatchingUtility.Combine(RB.gameObject);
    Now if I change the transform of RB, modifying position-rotation-scale etc, then will there be any negative performance effect?

    Edit1:
    The doc says I can do it.
    https://docs.unity3d.com/Manual/static-batching.html
    I am just not sure its performance implication.

    Edit2:
    I have no problem with gpu memory for the specific game I am working on, I just want rendering performance improvement.
     
    Last edited: Jul 25, 2022
  2. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    337
    I am only 99% sure about this but:

    the main rendering performance gain is the reduction of draw calls. That will happen so yes you will get that.
    I am not sure however if there is an additional tiny performance benefit of tagging a transform as static aka not moving. In theory I see the possibility for doing some optimizations there, but a) I don't know if unity is doing these (I actually think no, because the shaders don't look like vertex positions for unmoving meshes are not buffered in their target spaces) and b) the cost payed would be the cost of moving a single mesh hence pretty negligible.
     
    kaiyum likes this.