Search Unity

Unity tangent space creation, different from 3d max?

Discussion in 'Shaders' started by Lucas Meijer_old, Apr 5, 2008.

  1. Lucas Meijer_old

    Lucas Meijer_old

    Joined:
    Apr 5, 2008
    Posts:
    436
    Hi.

    I'm trying to get a normalmap on my 3d max character to work. The character is not skinned yet, it's just a plain mesh with a diffuse texture and a normalmap.

    Using the diffuse bump shader, it renders like this:



    In max the same normalmap renders like this:



    The lighting problems in the unity render seem to happen on the uv seams of the model. Here is the
    normalmap itself (downscaled for this post):



    In order to figure out what the problem is, I've written a simple shader that samples the normalmap, and transforms that normal into objectspace. The result looks like this:



    What it looks like to me is that the tangent space that unity generates when it imports my fbx, is not the same tangentspace that my normals are encoded in.
    Unfortunattely, I don't seem to have control over what tangent space max uses, and I also don't seem to have any control over what tangent space unity uses. I'm very curious to hear if people have any ideas on how to solve this.

    Thanks, Lucas
     
  2. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    By default the import settings automatically recalculate normals and use a normal split angle of 80 degrees. Switch it to 180 degrees instead.

    (Note that even if you specify set the normals to be defined in the max file, you still need to set it to 180 degrees in this case because the value is also used for the tangent split index)