Search Unity

Question What causes my normal map to be inverted on certain faces Unity URP + Blender

Discussion in 'General Graphics' started by WeItor, May 12, 2023.

  1. WeItor

    WeItor

    Joined:
    Nov 12, 2020
    Posts:
    4
    I have been struggling with this for a while and can't seem to find out how to fix it.
    8018e202ee9b3691bf8784e68092d183.png I have modelled this boat in blender and made a normal map in substance painter. I exported the normal map and imported straight into Unity using the urp metallic standard output template. To my surpise certain faces are inverted when shading it in Unity.

    I have no overlapping UV's in the problem area
    a978ff91bb98f19f8bdb69595af9836e.png
    no inverted faces (the blue image, should show red if inverted faces).
    ad9e896231197bc0cdd281e8e412e11c.png
    There are no broken vertex normals in blender though in this image you can see shading artefacts already.
    d2510b6a68628834bfe319be850c77ff.png
    In substance painter there are no shading issues.
    I have set the imported texture is checked as a normal map. From what I can see it should be something mesh related but what it is. No clue.

    I am using the urp and this is the normal map I have used.
    T_Target_Boat_N.png
     
  2. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,434
    That does look like a broken vertex normal for the affected polygons (where you say you see shading artifacts). You ruled out inverted normals but not continuous normals. It might be the difference between "shade smooth" and "shade flat" which end up giving different smoothing groups / split vertices in the import. Or it might be a ripped edge, which can cause the UV interpolation to be different. I would try this in Blender: go to object mode, apply scale, go to edit-mode, vertex-mode, merge-by-distance, face-mode, select-all, recalculate-normals-outside, shade-smooth.
     
  3. WeItor

    WeItor

    Joined:
    Nov 12, 2020
    Posts:
    4
    That did not seem to be the solution. It was still broken. I now deleted all the problem areas and remodelled them, it seems to work now. Though the problem is still a mistery