Search Unity

Multiple smaller textures/materials vs 1 large texture and few materials for performance/draw calls

Discussion in 'General Graphics' started by FlightOfOne, Jan 29, 2019.

  1. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    I have seen this question being asked before but it was around 2006-7. It was said that it is better to use 1, e.g. 4k texture, over 8 512k textures. Then I saw something (posted in 2016) contradicting this saying, along the lines of it doesn't really matter any more because of bathing.

    I would like to know as of 2018.x does this apply? Is it better to use 1 large texture over many small ones for better performance?

    I am working on a somewhat complex model with many parts. This will be used in VR so the up close quality has to be good. At the same I am trying to get a good frame rate. I can probably get a way with 2 4k textures or 1 2k and 6 512k if I split them up. The other option is to split up the mesh into smaller objects and create (or use Unity's if possible) some sort of a culling -e.g. when player is not looking at them rendered turns off.

    I would like to hear what you have done in a similar scenario, and would really appreciate any info you can share.

    Thank you!
     
    Last edited: Jan 30, 2019
  2. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    I just realized that I can probably use LOD groups (along with different quality texture/materials at each level) for this but it will force me to split the mesh up to smaller object, hence increasing the draw calls. I guess I will have to test and see what works best.
     
  3. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    It depends.

    We can't batch renderers if they use different textures or shaders. So it's a good idea to create texture atlases for renderers that can be batched. However if you are creating texture atlases for renderers that can't be batched then this is waste of work.

    There some rules that guide if an object can be batched or not. https://docs.unity3d.com/Manual/DrawCallBatching.html
    In the framedebugger you can check the objects that batch together and the reason the can't be batched.

    In LWRP and HDRP render pipelines we improved how we can batch objects compared to Built-in Pipelines.
     
    FlightOfOne likes this.
  4. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668

    I guess I have some reading to do, thank you!