Search Unity

Multiple materials with same shader

Discussion in 'Editor & General Support' started by MartinVM, Jan 16, 2007.

  1. MartinVM

    MartinVM

    Joined:
    Jan 15, 2007
    Posts:
    20
    Is there an easy way to apply and tweak the settings of a single shader on multiple materials at the same time?
     
  2. Joe ByDesign

    Joe ByDesign

    Joined:
    Oct 13, 2005
    Posts:
    841
    Don't know if this qualifies as "easy" but you might try editing the shader directly. Changes to the shader itself, should spread to all materials that use it.

    Might be wise to make a back up first!
     
  3. MartinVM

    MartinVM

    Joined:
    Jan 15, 2007
    Posts:
    20
    Would still have to apply it 1 material at a time to 100's of materials though.
     
  4. Joe ByDesign

    Joe ByDesign

    Joined:
    Oct 13, 2005
    Posts:
    841
    Ahh i forgot the "apply" part ;)

    You can probably do that through an editor script, but if you have a hundred or more materials, it is strongly recommended that you use fewer materials and share them between objects as much as possible.

    High end 3D engines like Unity's slows way down as you use more materials. More info here;

    http://unity3d.com/Documentation/Manual/Optimizing Graphics Performance.html
     
  5. David-Helgason

    David-Helgason

    Moderator

    Joined:
    Mar 29, 2005
    Posts:
    1,104
  6. MartinVM

    MartinVM

    Joined:
    Jan 15, 2007
    Posts:
    20
    To casemon: Yeah im well aware of how those limitations work, but even then i don't concider a couple hundred materials on your average level extreme.

    edit: thx david