Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Pants Of Model Do Not Receive Material Properly

Discussion in 'General Graphics' started by Hypocrita_20XX, Jun 7, 2016.

  1. Hypocrita_20XX

    Hypocrita_20XX

    Joined:
    Feb 8, 2014
    Posts:
    27
    Hey everyone, hope all is going well for you!


    I'm having an issue where basically it seems the pants of my model are rejecting UV coordinates.

    I honestly have no idea what's going on, the material being used is basically global to the model in question, and every other part of the model is rendering correctly. Global meaning the parts of the model use the same material within Unity and Blender.

    As reference, it should look like this on the pants.

    As you can see in this picture, everything is perfectly fine in Blender.
    It just seems something is getting lost in the export process, or something.

    If anyone has any ideas as to what the issue may be, do let me know. I would greatly appreciate it!


    Thanks, and take care!
     
  2. AkiraWong89

    AkiraWong89

    Joined:
    Oct 30, 2015
    Posts:
    662
    Check the UV and normal of the pants. Maybe something not right there.
     
  3. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    can you show the uv layout of the back of the pants with the texture overlaid?
    That is really odd looking - almost looks like the edge loops of the bottom of the legs are accidentally aligned - horizontally down, which would cause stretching.
     
  4. Hypocrita_20XX

    Hypocrita_20XX

    Joined:
    Feb 8, 2014
    Posts:
    27
    Hey AkiraWong89 and theANMATOR2b, thanks for the replies!

    Alright, checked the UV coordinates, the normals, and the seams to make sure that was all proper.

    Everything is as I intended in Blender.
    Within Unity, this is the material being used, in case it matters.

    I have tried messing with the UV set as there are two listed, but it changed nothing.

    Also of note is that I get these strange errors at run-time. I'm not sure these are affecting anything, but I'll mention it just in case.
     
  5. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Do you get the same visual error when just using a standard (not special) shader?
    Just guessing - trying to eleminate possabilities.
     
  6. Hypocrita_20XX

    Hypocrita_20XX

    Joined:
    Feb 8, 2014
    Posts:
    27
    Mm, unfortunately the same issue presents itself, just in a slightly different color.
     
  7. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Maybe just try to temporarily reposition the leg UVs in the UV layout and reexport.
    Just to see if there is some type of error in the UVs that is getting corrupted on export/import.
     
  8. AkiraWong89

    AkiraWong89

    Joined:
    Oct 30, 2015
    Posts:
    662
    @Hypocrita_20XX
    Can you make a tiny Unity project which contains the pant and dependencies?
    I will help you take a close look on it and check the problem.;)
     
  9. Hypocrita_20XX

    Hypocrita_20XX

    Joined:
    Feb 8, 2014
    Posts:
    27
    As per request, I tried moving the UVs, however that produced the same results. I also made a new project just for the pants and still no luck, unfortunately. Lastly, I tried unwrapping them again, but that also made no difference within Unity.
    I'll be looking more into it today, however.

    EDIT: I think I found the issue: somehow there were multiple UV sets within Blender, and as best I can tell, Unity was basically picking at random which ones to use. For instance, you would have the correct diffuse map with an incorrect AO/specular/normal map, all of which on different UV coordinates.
    The first step in fixing was to delete the UV sets that weren't needed or being used (one of which showed, very clearly, the issue with the pants taking on the material of the chestpiece.)
    The next step involved unwrapping them again onto the same diffuse map, and ensuring my materials respected this change in UV maps.
    Lastly I just had to remove the other maps and only have diffuse within Unity, and it seems like I'll just need to go back in and do a re-unwrap for all the maps for it to finally behave properly.
    Thanks for all the help, and take care!
     
    Last edited: Jun 9, 2016
    theANMATOR2b likes this.
  10. jvo3dc

    jvo3dc

    Joined:
    Oct 11, 2013
    Posts:
    1,520
    Texture wrapping set to clamp instead of repeat by any chance?