Search Unity

Converting normal maps from Unreal Engine to Unity?

Discussion in 'General Graphics' started by ridethefader, Oct 10, 2020.

  1. ridethefader

    ridethefader

    Joined:
    Jun 17, 2019
    Posts:
    44
    When I create a normal map for Unity using Substance, I have to specify that its for Unity. I already have a ton of normal maps from UE4 that Im migrating over to Unity. Flipping the green channel does not seem to do the trick. How can I convert all these UE4 normal maps to Unity?
     
  2. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,665
    I found an older thread asking - more or less - the same question here and another user said the following:
    (Source: https://forum.unity.com/threads/ue4-normal-map-in-unity.540901/#post-3566323 & https://forum.unity.com/threads/ue4-normal-map-in-unity.540901/#post-3567130)

    I assume you've tried any of that already?

     
  3. ridethefader

    ridethefader

    Joined:
    Jun 17, 2019
    Posts:
    44
    Yeah, I saw that thread. Theres more to it than just flipping the green channel, but I'm not sure exactly what it is. If I knew what it was, then I could just manually make that change in all the normal maps. But for whatever reason, flipping the green channel just isnt working for me at all.
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    If flipping the green channel isn't working as you expect, it may be that the normals need to be regenerated from scratch. But without seeing what you're seeing in Unreal vs what you're seeing in Unity I can't say for sure. However Unity's built in rendering paths use OpenGL style normal map orientation and per vertex bitangents, where as Unreal uses the Direct3D style normal map orientation and per pixel bitangents. Unity's new SRPs use a combination of both per vertex and per pixel bitangents depending on which SRP, which SRP version, and which shader you're using (they're working on making it more consistently per pixel bitangents).

    Unfortunately there's no clean way to convert from per vertex bitangents to per pixel bitangents. So if that's the problem, the only option is to bake out the normal maps again with the appropriate setting, if the program you're using has the option to it. Or use custom shaders that do per pixel bitangents. Technically you could even make your shaders use Direct3D style normal maps fairly trivially.

    https://medium.com/@bgolus/generating-perfect-normal-maps-for-unity-f929e673fc57
     
  5. ridethefader

    ridethefader

    Joined:
    Jun 17, 2019
    Posts:
    44
    Ah, ok that makes sense! Thank you for clearing that all up. Yeah, its all exported from Substance Designer/Painter, so I'd just have to go back and export out all the normal maps again it seems. Will take me some time, but it seems this is the only way to do it. Thanks again for the detailed explanation.