Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Mesh UV Errors

Discussion in 'General Graphics' started by Mhmud-Fadel, Jan 17, 2016.

  1. Mhmud-Fadel

    Mhmud-Fadel

    Joined:
    Nov 13, 2013
    Posts:
    41
    Hi :)
    in the following screenshot:
    uv_error.jpg
    I hope know how to fix uv in unity ?
     
  2. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    In order to have correct uvs for light mapping in Unity, they are not allowed to be overlapping. It seems that all three sides are using the exact same uvs, that's why you are getting this effect.
    There are two possible solutions:
    • Create a non overlapping uv layout
    • Select "Generate Lightmap UVs" in the mesh import settings (this will create the non overlapping uvs for you)
     
    karl_jones and theANMATOR2b like this.
  3. Mhmud-Fadel

    Mhmud-Fadel

    Joined:
    Nov 13, 2013
    Posts:
    41
    How can I create a non overlapping uv, generate uv mapping inside Unity not fix the problem ?
     
  4. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Are you baking in Unity?
     
  5. Mhmud-Fadel

    Mhmud-Fadel

    Joined:
    Nov 13, 2013
    Posts:
    41
    No, I used 3ds max 2014 + Flatiron plugin (flatiron is light baking plugin for 3ds max )
     
  6. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    In that case I can't tell you how you need to do it in 3ds max. What's necessary is that you unwrap each of those three planes, such that the uvs are not overlapping each other. That's already done, as you can clearly see 4 different sectors on the baked texture. This uv layout has to be used in Unity to show the baked result. It might be that the planes were unwrapped more than once, leading to different uv layouts and the baked texture uses the wrong one.

    For this use case it is important that you don't create the uvs in Unity!
     
  7. Mhmud-Fadel

    Mhmud-Fadel

    Joined:
    Nov 13, 2013
    Posts:
    41
    That is what I need, How can prevent Unity to auto UV my imported meshes ?
    p.s: when i imported my same meshes in Unreal Editor, the UV appears correct !
     
  8. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Select your model in the project panel. There are the setting for it. Make sure that the lightmap uvs are now generated.
     
  9. AkiraWong89

    AkiraWong89

    Joined:
    Oct 30, 2015
    Posts:
    662
    Just checked the Flatiron plugin. Looks like it will create UV2 for selected objects to bake lightmap. I believe the 3 planes are just created and didn't touch anything on UV yet? If so. That's why it has a problem on Unity. Unity use UV2 to display lightmap and UV1 is for textures. You are displaying the lightmap result in the 1st UV channel. That's why.

    There are 3 solutions:
    Solution 1:

    Combine the baked lightmap into your diffuse map (UV1) by using painting software or some tools.

    Solution 2:
    Find custom shader that allow you to put textures and baked lightmap manually.

    Solution 3:
    Make your own or let Unity generate the UV2 and do lightmap baking on Unity.
     
  10. Mhmud-Fadel

    Mhmud-Fadel

    Joined:
    Nov 13, 2013
    Posts:
    41
    right, all baked textures using uv Channel 2, is this the problem ?

    How can do that with photoshop ?
     
    Last edited: Jan 30, 2016
  11. Mhmud-Fadel

    Mhmud-Fadel

    Joined:
    Nov 13, 2013
    Posts:
    41
    Fixed :) I found a solution, easily in Unity, in mesh inspector check Swap UVs and press apply
     
  12. AkiraWong89

    AkiraWong89

    Joined:
    Oct 30, 2015
    Posts:
    662
    You can use Render to Texture function in 3dsMax to transfer images into different UV set but nevermind and congratulation on solution found. You can use this shader (Choose under shader menu): Legacy Shader > Lightmapped > Diffuse for just in case you have a diffuse map. If you use this shader. Make sure to swap back your UV.:)