# question about multiple materials

**URL:** <https://discussions.unity.com/t/question-about-multiple-materials/398447>\
**Category:** Shaders & Materials\
**Created:** [September 21, 2009, 2:50pm UTC](https://discussions.unity.com/t/question-about-multiple-materials/398447 "2009-09-21T14:50:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon\_65669922](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@anon\_65669922](https://discussions.unity.com/u/anon_65669922)\
**Post date:** [September 21, 2009, 2:50pm UTC](https://discussions.unity.com/t/question-about-multiple-materials/398447/1 "2009-09-21T14:50:36Z")

</div>

sorry if I’m asking some stupid questions, but I really have searched a lot on references and the forum, still cannot find the use of materials.  
My question is why it need multiple materials on one gameobject？ Does it only mean it can be easy to switch between different materials? such as:

```auto
if( flag < 0) 
 gameObject.meshrenderer.material = gameObject.meshrenderer.material[1];
else
 gameObject.meshrenderer.material = gameObject.meshrenderer.material[2];

```

or it can be used to make one mesh has two different parts,each part has a material?

Also, I have made a project that can load more than 100 3D models in one scene, such as an indoor scene. Each model has more than 2 sub objects, each has a corresponding texture. Such a scene renders rather slow. Is there any method to accelerate the rendering speed?

the drawcalls is around 2000, tris 553.7K, verts 1.7M, texture 236-80.7MB, render texture 20-16.9MB

---

<div class="post-metadata">

**Author:** ![jmunozar](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/jmunozar/32/44194_2.png) [@jmunozar](https://discussions.unity.com/u/jmunozar)\
**Post date:** [September 21, 2009, 9:41pm UTC](https://discussions.unity.com/t/question-about-multiple-materials/398447/2 "2009-09-21T21:41:19Z")

</div>

Hello,

You do not need more than 1 material in one GameObject. looks like you are using objects designed to make renders, not for real time 3d projects :s

If you can, try to use 1 material per gameObject, It would help a _lot_ on your project performance.

Also, you can render selectively to gain more performance,make sure also your meshes are optimized.

---

<div class="post-metadata">

**Author:** ![anon\_65669922](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@anon\_65669922](https://discussions.unity.com/u/anon_65669922)\
**Post date:** [September 22, 2009, 1:51am UTC](https://discussions.unity.com/t/question-about-multiple-materials/398447/3 "2009-09-22T01:51:49Z")

</div>

thanks. If one material is proper for one gameobject,then, why it has a material array for each gameobject? what’s the use of it?

Secondly, I have tried the large scene in Openscenegraph which uses C++ and opengl to render, it does not suffer any frame rate slow problems. It’s kind they use scenegraph and some other accereration schemes to optimize the rendering speed. Is there any smilar accertating scheme in unity because the same scene looks much slower than openscene graph. If not now, have you guys any plans on that?

---

<div class="post-metadata">

**Author:** ![Eric5h5](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/eric5h5/32/44225_2.png) [@Eric5h5](https://discussions.unity.com/u/Eric5h5)\
**Post date:** [September 22, 2009, 2:03am UTC](https://discussions.unity.com/t/question-about-multiple-materials/398447/4 "2009-09-22T02:03:07Z")

</div>

> [@""](#):
>
> If one material is proper for one gameobject,then, why it has a material array for each gameobject? what’s the use of it?

You can’t always do everything with one material…if you have a character, for example, you have skin+clothes+hair+eyes+teeth which is probably going to be at least three different materials, depending on the look you’re going for. But you want them all on one object, because you don’t want to separately animate several different parts and combine them together manually somehow, which would be painful.

For indoor scenes, it’s not hard to implement your own kind of portal culling using triggers.

–Eric

---

<div class="post-metadata">

**Author:** ![anon\_65669922](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@anon\_65669922](https://discussions.unity.com/u/anon_65669922)\
**Post date:** [September 22, 2009, 2:26pm UTC](https://discussions.unity.com/t/question-about-multiple-materials/398447/5 "2009-09-22T14:26:22Z")

</div>

thanks, that’s very helpful! Is there any portal culling scripts available to reference?

---

<div class="post-metadata">

**Author:** ![Eric5h5](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/eric5h5/32/44225_2.png) [@Eric5h5](https://discussions.unity.com/u/Eric5h5)\
**Post date:** [September 22, 2009, 2:56pm UTC](https://discussions.unity.com/t/question-about-multiple-materials/398447/6 "2009-09-22T14:56:10Z")

</div>

I’m not sure if there’s any actual example code, but this subject has come up more than once and has been discussed in some detail, so hopefully a search would find more info.

–Eric
