Search Unity

16 bit normal map issue

Discussion in 'General Graphics' started by Kamil_Reich, Dec 11, 2016.

  1. Kamil_Reich

    Kamil_Reich

    Joined:
    Aug 14, 2014
    Posts:
    195
    Hi, we were talking on two forums about normal map quality and it not look good in unity. I want to use only normal map baked from high poly in standard shader and it's not looking good.
    Topics:
    https://forum.allegorithmic.com/index.php/topic,13965.msg61288.html#new
    http://community.cgcookie.com/t/normal-map-16-bit/8056
    May you check into unity this one? That's may be on your files, if i bake in substance painter it looks ok in blender but not ok in unity, baked in blender looks ok in blender but not in unity.
    Sending files:
    high and low poly:
    https://www.dropbox.com/sh/lpf7kmqwcmrchim/AADD-Os1ks8RMZl4SDcTqo0Ea?dl=0
    And normal map to download. Rim_01_mid_2_normal.png
    http://i.imgur.com/XOtfB03.jpg
    http://i.imgur.com/4xnPGXc.jpg
    http://i.imgur.com/aNxzX72.jpg
    http://i.imgur.com/fqEVI3W.jpg
     
  2. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,832
    It looks like "banding". YOur material has no texture assigned in the slot. Try giving it a texture of some sort to see if the banding is eliminated. This happens to me when I try to set a color without any texture.
     
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    There isn't a single "perfect" way to calculate and use normal maps. Beyond just the commonly known types, like +Y vs -Y (Unity vs Unreal, actually based on OpenGL vs DirectX texture coordinate differences), or tangent space vs object space vs world space, there's also different ways to calculate tangent space.

    However one of the most important factors when calculating and using a normal map is making sure the tangent is calculated exactly the same way.

    Early on almost every engine and modeling program were a little different in how they did it. These days most programs are using what's known as MikkTSpace, based on Morten Mikkelsen's master thesis paper. Unity, Substance and Blender all use MikkTSpace, but for some reason I've never seen normals rendered out of Blender work perfectly in Unity. I don't have an explanation for that, I even spent some time going through Blender's source to see why it wasn't matching, but I never find anything obvious so I gave up (especially since I don't use blender regularly). Personality I always use Xnormal regardless of what program I use to model with.

    As for 16bit normals, Unity only supports 8bit per channel normal maps by default. In Unity 5.5 the "high quality" option just uses BC7 instead of the BC3/DXT5 based "DXTnm", but BC7 is still 8bpc. To use 16bpc normals you need to not use the "normal" texture type, and use the BC6H format. Then you would need to use your own shaders which do not call Unity's built in UnpackNormal() function as that will always assume a "DXTnm" setup with the red channel stored in the alpha.
     
    Sr-Smiling and theANMATOR2b like this.
  4. Kamil_Reich

    Kamil_Reich

    Joined:
    Aug 14, 2014
    Posts:
    195
    Thanks for reply, I will look deeper into this on evening :)
     
  5. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
  6. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    I long for a world (or at least Unity) with default BC5_SNORM support, and BC6H_SF16 or RGHalf for high quality normals. Maybe when DX9 support is finally put to bed.
     
  7. Kamil_Reich

    Kamil_Reich

    Joined:
    Aug 14, 2014
    Posts:
    195
    Ok, that's how it looks like when added little noise (model on left is only normal map on standard shader).
    http://i.imgur.com/sKUt6ii.jpg
    Video is before distorsion.