I want to use a .mtl file to draw my objects in unity. Can I somehow convert a .mtl file into a normal Unity material?

My .mtl file is like this:

newmtl phongE1SG
illum 4
Kd 0.00 1.00 0.00
Ka 0.00 0.00 0.00
Tf 1.00 1.00 1.00
Ni 1.00
Ks 0.50 0.50 0.50

Is this the same as a Unity material which has the sliders "albedo", "metallic", "smoothness", etc?

Or is there any shader to do it?

  • \$\begingroup\$ No, this isn't the same as Unity's standard material. Unity now uses a physically-based rendering (pbr) system — you can tell by the way it uses metallic and smoothness parameters instead of the older style of specular exponent and sharpness values that the .mtl format uses. Do you want a result that roughly matches your original material and looks good/realistic in Unity's PBR lighting system, or one that faithfully recreates the older phong-style shading your material file describes? \$\endgroup\$ – DMGregory Mar 13 '18 at 11:57
  • \$\begingroup\$ Allright , im sorry i didnt really know that. Yes, i would like to recreate the original Material which would look roughlike like what stands in those parameters. \$\endgroup\$ – OC_RaizW Mar 13 '18 at 12:13
  • \$\begingroup\$ @DMGregory Should I delete this Question now? Or should I change the question? Is there even a "roughly" answer to this question? \$\endgroup\$ – OC_RaizW Mar 13 '18 at 12:24
  • 1
    \$\begingroup\$ Sure there's an answer. It's not a super satisfying one ("copy the material colour values then play with the sliders until it looks right"), but I think with a few tips about how to do this / what to look for, it could be a worthwhile answer. I just don't have time to write it just this moment. Maybe someone else will beat me to it. :) \$\endgroup\$ – DMGregory Mar 13 '18 at 12:55

Yes. You can use .mtl file directly to create a material and apply a texture, used in unity. (Yet I have only tested it on .obj files).

For example: Just create Cube.obj or take any .obj file. Edit the .obj file in any TextEditor and get the Material name used in the object,.

Then create a .mtl file and assign whatever value you want, like color, texture map, etc.

If you still don't understand it, comment here. I will make a video to help you understand.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.