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

Question Unreal Engine HRM maps with Unity's HDRP Lit shader

Discussion in 'High Definition Render Pipeline' started by puksometron, Dec 6, 2022.

  1. puksometron

    puksometron

    Joined:
    Apr 14, 2018
    Posts:
    4
    Hi all,

    So I'm using models from Unreal Engine with Unity, and it seems they are using HRM maps. Upon first inspection, they look like Unity's equivalent to mask maps. I did try to find some info on them, and I did stumble across a comment saying that HRM maps also incude height map data, I can't seem to find the post though. Does anyone know much about HRM maps and how they can be used in Unity HDRP? Any suggestions would be much appreciated.
     
  2. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    642
    Hi,

    HDRP mask map is M/AO/D/S.
    You can use the recent addition in the texture import settings to swizzle the texture channels to map HRM -> MAODS :
    - Output red channel = input blue channel (metal)
    - Output green channel = 1
    - Output blue = 1
    - Output alpha = 1 - input green channel (roughness = 1 - smoothness)

    The height map input in the HDRP lit shader is a dedicated texture, single channel.

    Or you can build a shadergraph to use the HRM map as it is, manually connecting the channels where needed.
    Height will either be used for vertex displacement, or per pixel parallax displacement with the parallax offset node.

    Edit: Corrected the channels mapping
     
    Last edited: Dec 7, 2022
    tmonestudio and shikhrr like this.
  3. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,109
    I think u meant
    M/AO/D/S
     
    AcidArrow likes this.
  4. puksometron

    puksometron

    Joined:
    Apr 14, 2018
    Posts:
    4
    Thanks for the quick reply. Where exactly are the import settings for remapping the texture channels? I can't seem to find them.
     
  5. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    330
    Unity dosen't have the settings,you have to do it in thrid party softwares.
     
  6. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    642
    @jjejj87 Indeed, thanks for noticing, I've fixed my message :)

    @puksometron , @LumaPxxx : Starting with Unity 2022.1, the swizzle settings are available in the texture import settings pannel :
    upload_2022-12-7_8-40-22.png
     
  7. puksometron

    puksometron

    Joined:
    Apr 14, 2018
    Posts:
    4
    Interesting new feature, I'm still on 2021 LTS so it seems I'll need a different solution for the time being. The tool that exported the Unreal assets created HDRP-compatible shaders for every material, so I have near 100 shaders for each material, which makes it harder to optimise through texture atlasing as I have to use a single shader where possible.
     
  8. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    552

    Many other tools ( including Unreal) will allow you to remap for channel packing.
    Unity, isn't specifically allowed to comment or favour asset store tools, but there are some there too.

    For a short list though on both free and paid assets.

    Unity Art Engine
    Substance Designer/Sampler
    Photoshop
    Quixel Mixer
    any and all DCC tool like Maya, C4D and Blender
    Git hub ( redirects to unity forum mention)

    as also mentioned the Swizzler for the importer in 2022, you can absolutely still use that in 2021, you'll just have to do the packing in 2022 and send it over, if you want a super straight forward workflow with software you may be more familiar with.
     
  9. puksometron

    puksometron

    Joined:
    Apr 14, 2018
    Posts:
    4
    I'll probably try this out on 2022. Thanks for the information :)
     
    HIBIKI_entertainment likes this.