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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Different Materials, different Textures, Same Shader and SRP Batcher

Discussion in 'Universal Render Pipeline' started by the3ddy, Dec 31, 2020.

  1. the3ddy

    the3ddy

    Joined:
    Jul 20, 2020
    Posts:
    2
    Hey all, I'm pretty new to this SRP Batcher, and found lots of good resources reading on this such as these:
    https://forum.unity.com/threads/srp-batcher-and-gpu-instancing.833362/
    https://cmwdexint.com/2018/06/19/batching-techniques-in-unity/#more-1096
    and a few other posts.

    One question I have is, if my understanding is correct, is it possible to use different materials of the same shader but uses different texture and get SRP batched together? For example, in an extreme case if I hypothetically have a scene that uses all the same shader but are different materials each referencing their own separate texture, will they get the benefit of being SRP batched together?
     
  2. Bosozuki

    Bosozuki

    Joined:
    Dec 19, 2013
    Posts:
    63
    Yes

    One thing to note if the texture has a alpha cutoff (sprite atlas of some sort) it may break the batch based on distance from the camera
     
    the3ddy likes this.
  3. the3ddy

    the3ddy

    Joined:
    Jul 20, 2020
    Posts:
    2
    awesome, thanks for the prompt response.
     
    Bosozuki likes this.