Search Unity

Static Materials Error Message

Discussion in 'General Graphics' started by TeKniKo64, Jul 22, 2018.

  1. TeKniKo64

    TeKniKo64

    Joined:
    Oct 7, 2014
    Posts:
    30
    I am using modular models, that use the same one material. When I set my prefabs to static, I get this warning message.

    "This renderer is statically batched and uses an instanced shader at the same time. Instancing will be disabled in such a case. Consider disabling static batching if you want it to be instanced."

    I really have no idea what this error means, even after a Google search. My models need to be static (housing). What should I be enabling/disabling? Or should I ignore this message entirely?
     
  2. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    There should be a checkbox on the material to enable instancing. Uncheck this.
     
    AlterMannn and yyylny like this.
  3. TeKniKo64

    TeKniKo64

    Joined:
    Oct 7, 2014
    Posts:
    30
    But what does that do? Do I not want instancing on for better performance? @LennartJohansen
     
  4. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    you need to choose what kind of batching you want. In this case static batching vs instancing. you can not use both.
    Static batching is probably better in this case. Instancing is better for dynamic objects.
     
  5. TeKniKo64

    TeKniKo64

    Joined:
    Oct 7, 2014
    Posts:
    30
    Thank you.
     
  6. flixtgi

    flixtgi

    Joined:
    Sep 17, 2017
    Posts:
    6
    I unchecked it, the warning message goes away. But when I play, the objects turn invisible and its like their materials are not there. I check my scene during gameplay and the materials are on the objects. What does this mean?
     
  7. KoenKruk

    KoenKruk

    Joined:
    Apr 23, 2020
    Posts:
    4
    I have this problem too.
     
  8. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,756
    Ok, to be static batched, it must be tagged as staic batched (top right corner in the inspector, when selecting that object). "Enable GPU Instancing" must be unchecked on materials.

    Also if you have baked Occusion Culling before changes, you must re-bake occlusion culling, as the tags have been changed...
     
    Last edited: Sep 20, 2022