Search Unity

Tangents - Weird Normal Maps

Discussion in 'General Graphics' started by Unique-Player, Jun 25, 2020.

  1. Unique-Player

    Unique-Player

    Joined:
    May 6, 2017
    Posts:
    78
    I have spent whole day trying to understand the problem with normal maps and tangents, and here what i have found.

    What we have: A plane and simple normal map with convex box in it. Problem is The box is lighted incorrectly, as it is convex from one direction and is concave from another. The tests are below.

    Standard Unity Plane with applied normal map - behaving abnormally, sides are lighted correctly, but top and bottom parts as you can see are dark, meaning that it is not a convex, but a concavity.

    See attached image - https://drive.google.com/file/d/1HmhD5lN3vKa-U9L9xLKvbHpx837rufi1/view?usp=sharing

    Plane from blender is behaving similarly with tangents set to Import and Mikktspace. But if set to none plane is lighted correctly

    See attached image - https://drive.google.com/file/d/1s5okgV_7z5W4K7tVm5oiYJN2Qn7AQNUl/view?usp=sharing

    So my questions would be:
    - Is this how it supposed to work? May i assume that Mikktspace is optimized but not accurate?
    - Is my normal map maybe somehow is incorrect?

    I am attaching Normal Map so you can check it for yourself.

    Any help is appreciated, i do not want to spend the next day trying to solve it.

    Thank you.
     

    Attached Files:

  2. Unique-Player

    Unique-Player

    Joined:
    May 6, 2017
    Posts:
    78
    UPD: As always after posting, the solution is found.
    Problem is in the Normal Map, it should in OpenGL format Y+.
    My Normal maps are then most likely to be in Direct3D format Y-.