Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

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:
    87
    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:
    2,519
    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:
    87
    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.