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 What is most optimal when considering GPU Instancing

Discussion in 'General Graphics' started by ClearRoseOfWar, Nov 26, 2022.

  1. ClearRoseOfWar

    ClearRoseOfWar

    Joined:
    Sep 6, 2015
    Posts:
    89
    I would like to know which option is more optimal when it comes to using a single pallet texture:

    A: Have many materials designated to each object with instancing enabled. Each Mesh has its own material.
    B: Have 3 variations of the same material(Spec, Metal, Standard) and apply it to different meshes. So each Mesh in my scene is using one of the 3 Materials.

    Objects are static (Don't move) in both cases.
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,969
    B is more optimal. Sharing the same material (and preferably also mesh) is a lot more performant and this can make use of dynamic batching!

    Better answer: try it and run the profiler
     
    ClearRoseOfWar likes this.
  3. ClearRoseOfWar

    ClearRoseOfWar

    Joined:
    Sep 6, 2015
    Posts:
    89
    Thank you for your reply.

    Thats a great idea, I will try it in a sperate scene and see what results I get!
     
    DevDunk likes this.