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. Dismiss Notice

Question Materials with different params

Discussion in 'Universal Render Pipeline' started by SpookyCat, Apr 6, 2023.

  1. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    It says in the docs that using MaterialPropertyBlocks to change values in a shader breaks the batching in URP. So what is the correct way if I have hundreds of objects sharing the same material to have a different value per object. Do I duplicate the material so each object has a unique material or is there some other system in place?
     
  2. jgamboa_unity

    jgamboa_unity

    Joined:
    Oct 7, 2020
    Posts:
    4
    I'd like to ask this as well -- bumping so that this gets attention.
     
  3. gshape

    gshape

    Joined:
    Aug 8, 2012
    Posts:
    103
    duplicate material at editor time. or just use renderer.material to clone an instance in runtime and modify its value