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

Cant dynamic batch because objects have different materials on particle system

Discussion in 'Editor & General Support' started by ducloc96, Apr 2, 2022.

  1. ducloc96

    ducloc96

    Joined:
    Mar 18, 2018
    Posts:
    26
    Cant dynamic batch because objects have different materials on particle system.
    Can anyone explain it to me?
     

    Attached Files:

    • 3.PNG
      3.PNG
      File size:
      76.8 KB
      Views:
      211
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    9,753
    What do you need explained? You can only dynamically batch the same material, not a host of different ones.
     
  3. Max-om

    Max-om

    Joined:
    Aug 9, 2017
    Posts:
    486
    You might be able to fix this with a custom particle material and texture arrays. Advanced topic though
     
  4. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    9,753
    Or just use Material Property Blocks, which aren't an advanced topic. They don't get batched either but dramatically reduce overhead regardless.

    https://thomasmountainborn.com/2016/05/25/materialpropertyblocks/
     
    Max-om and neginfinity like this.
  5. ducloc96

    ducloc96

    Joined:
    Mar 18, 2018
    Posts:
    26
    I have 2 draw dynamic glows. It's the same effect I spawned but it requires 2 draw calls. I don't understand why is it like that?
     

    Attached Files:

    • 4.PNG
      4.PNG
      File size:
      75.2 KB
      Views:
      193
    • 5.PNG
      5.PNG
      File size:
      75.7 KB
      Views:
      194
  6. Max-om

    Max-om

    Joined:
    Aug 9, 2017
    Posts:
    486
    Not all foliage can be combined into one though using property block. If you make the foliage from scratch it's a different story.

    Edit: ah sorry forgot topic was about particles not foliage :) but same logic applies
     
  7. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,509
    It could be worth noting that not everything needs to be "combined into one", and sometimes it doesn't help.

    First up, this stuff matters when you have a huge number of things and need to avoid the overhead of having many draw calls. When I say "many" think "at least dozens, but probably hundreds". Put your effort where it'll make the biggest difference.

    Second, batching isn't free, it takes effort - from the developer, the computer, or both. So getting a small number of batches down to one batch could in fact cost more than it saves, depending on where your bottlenecks are.