Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Unreal-Material in HDRP/Lit Unity translation?

Discussion in 'High Definition Render Pipeline' started by OC_Raiz, Apr 7, 2020.

  1. OC_Raiz

    OC_Raiz

    Joined:
    Jul 4, 2016
    Posts:
    5
    So.. I have been working on a Unreal-Project, for.. quite some time.
    But now I wanna switch my project to Unity.

    So...
    I see that the Unity Materials have different names for the same parameters.

    So...
    Unreal - > Unity

    Albedo_Map -> Base Map / Default
    Normal_Map -> Normal map

    And... yeah, so far so good, I really don't get where I am supposed to map the Compact_Map ?

    I know that it cant be 100% ly converted but help me out a bit guys, i just wanna have a rough Idea how to convert these materials

    (attachment shows both materials)
     

    Attached Files:

  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,022
    Olmi likes this.
  3. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
    Hi,
    I couldn't find the manual entry for Unreal but if this is correct (please verify, someone.)

    Unreal's Compact Map:
    Red channel = Ambient Occlusion
    Green channel = Roughness
    Blue channel = Metallic
    Alpha channel = Height

    And Unity's Mask Map (if you check the tooltip):
    Red channel = Metallic
    Green channel = Ambient Occlusion
    Blue channel = Detail Mask
    Alpha channel = Smoothness

    So split that map somehow or use tool like that what mgear suggested (if it can do the task you need) and combine the maps so that it fits Unity's HDRP.

    Other channels / data:

    Albedo => Base Map (Base color(RGB) and opacity(A)
    Normal map => Normal Map
    Emissive color = Emissive Map
    ...and map you've used in some DetailTexturing node in Unreal would go to Detail Map
     
    Last edited: Apr 7, 2020
    MaximKom and OC_Raiz like this.
  4. OC_Raiz

    OC_Raiz

    Joined:
    Jul 4, 2016
    Posts:
    5

    I love you.

    According to this:
    https://share.substance3d.com/libraries/2763

    Your Unreal Map description is correct
     
    Last edited: Apr 7, 2020
  5. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Thing is with shader graph you don't need to be doing any changes to textures. Just rewire the compact map. BTW, UE's choices for map channels look better than Unity's. Unity's has some legacy decisions and support for the detail channel you might not even use. For example blue typically will compress badly so metallic is best off in the blue channel.

    It takes a couple of mins to get used to Unity's Shader graph which is quite similar to UE's material graph.

    The docs are really super clear about these, maybe read 'em.

    https://docs.unity3d.com/Packages/c...high-definition@9.0/manual/HDRP-Features.html

    Be sure to select the version of HDRP docs you want from the drop down.
     
  6. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    932
    >For example blue typically will compress badly so metallic is best off in the blue channel.

    Red and blue are very close for compression (this can indeed be tweak depends on compressor but don't think Unity do anything here), only green could differ (be better quality) depends on the format. (i.e 565)

    We chose Smoothness in Alpha as alpha depends on the format could have better precision (for example with DXT5). And we support the fact that smoothness is extremely important :)

    With BC7 all channel are very similar.

    But yeah, shader graph here is the way to go, avoid all the heache of conversion.
     
    hippocoder likes this.
  7. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    And Unity keeps alpha linear not sRGB I think (I will need to confirm). If it's smoothness / data for importer.
     
  8. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    932
    It is not Unity, the flag sRGB in any 3D API keep alpha linear (so either you use sRGB or not, alpha is always linear)
    and a mask map must always be linear anyway :)