- Home /
material on .obj is just a solid color
I have an .obj file which you can find here https://ufile.io/ms5ee
It loads fine into unity, but when I apply a material to the meshpart, it's just a solid color.
The material I'm trying to apply is a map that you can find here: https://ufile.io/95qs1
I don't have vertex textures (vt u v w) in my .obj file because I don't understand why they are necessary or how they work.
If the problem is that my file lacks uv mappings, how do I go about fixing that?
Answer by MarshallN · Dec 06, 2017 at 10:10 PM
The problem is, in fact, that you don't have UV mappings. A UV map is a texture map for the mesh, a set of Vector2s of equal length to the number of vertices that lets the graphics engine know which pixel of the texture is at each vertex (and then the graphics engine will interpolate between them. If you don't set the UV map, it assumes every point on the mesh is at (0,0), the upper left corner of the mesh, thus stretching the color of the pixel at the upper left corner over the entire object.
The wikipedia article on UV mapping is good - start there. I don't know what program you used to make the .obj file, so I can't help with the specifics, but if you google 'how to uv map in (program)', I'm sure there will be numerous tutorials available.
Answer by kevinforrestconnors · Dec 07, 2017 at 01:33 AM
Thanks, I made the .obj file programmatically so there are no vt in it right now