Multiple of the same material

Hello,

I have over 10 maps with about 400+ materials each. The reason why there is so many materials is because there are duplicates of the same material. My question is, is it better to leave the duplicates or combine them? (performance boost?) here is an example of what my .mtl file looks like:

newmtl m2
Kd 1.000000 1.000000 1.000000;
Ka 0 0 0
illum 2
Ns 64
d 1.000000
map_Kd 951E01Other4040.bmp

newmtl m3
Kd 1.000000 1.000000 1.000000;
Ka 0 0 0
illum 2
Ns 64
d 1.000000
map_Kd 951E01Other4040.bmp

newmtl m4
Kd 1.000000 1.000000 1.000000;
Ka 0 0 0
illum 2
Ns 64
d 1.000000
map_Kd 951E01Other4040.bmp

newmtl m5
Kd 1.000000 1.000000 1.000000;
Ka 0 0 0
illum 2
Ns 64
d 1.000000
map_Kd 951E01Other4040.bmp

newmtl m6
Kd 1.000000 1.000000 1.000000;
Ka 0 0 0
illum 2
Ns 64
d 1.000000
map_Kd 951E01Other4040.bmp

And so on…
Notice the image and the material color are all the same, it just has a different name (m2, m3, m4, m5, m6)

Will this impact my performance with a finished game with about 10,000 materials (for all maps total)?

-If this does impact it, how would I go about combining these so instead of m2, m3, m4, m5 and m6 I just have m2 without having to do this manually (I would also need to go into my .obj and manually change those too)?
-Is there a program that will remove duplicates for me?
-Possible a sed command in terminal that will create an index of duplicates and delete all but the first of the duplicates?

Sorry this post is so long and confusing.

Any help is much appreciated, thank you! :slight_smile:

Hmm , maybe turn off the Material Generation when you import the objects… than manually create and monitor your own materials. Im no wiz in the shader / material department, but im fairly sure, that 10, 000 materials, is pretty crazy.