Search Unity

UE4 Normal map in Unity

Discussion in 'Shaders' started by echologin, Jul 17, 2018.

  1. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    OK so I have this model that works fine in UE4

    normal map seems messed up in unity ... I tried in shader flipping the Y did not work
    ( tried flipping each and all channels nothing worked )

    there must be a way to read that properly in shader

    anyone know ?
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,797
    Screens?

    Are the normals and the tangents okay?
     
  3. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    I can't post screenshots its work I'm doing for some other company
    I know the normals are different I read about people reversing green channel when going from unity to ue4

    tho i will ask them if its ok
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    If they’re tangent space normal maps, then flipping the green channel is all that should be needed. If they’re world space normals then you’ll probably need to swap the green and blue channels, and flip one of them.
     
  5. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    Did you actually adjust the import settings of said texture to be of texture type Normal Map?
     
  6. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    Ill try that
     
  7. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078

    yes
     
  8. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    Also, if they're object or world space normal maps know you cannot use Unity's built in shaders, none of them support object or world space. Also you cannot set the textures to be normal maps in that case, but must keeping them the default texture type with sRGB disabled.

    Unity's HD pipeline shaders does support object space normal maps though.
     
  9. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    its a custom shader I was thinking if I could translate it in shader
    it would save the client some time ...

    it does seem like its not in same "space" because it changes on the X axis
    so that parts of model on +X side look right on -X side they don't
     
  10. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    Turned out the tangents on model where messed up

    nothing to do with the normal map