Search Unity

Question Trouble converting standard material to HDRP

Discussion in 'High Definition Render Pipeline' started by mroshaw, Oct 9, 2022.

  1. mroshaw

    mroshaw

    Joined:
    Oct 11, 2020
    Posts:
    47
    Hello! I bought an asset on the store, "Corals 2", that contains some nice-looking underwater flora. Unfortunately, the materials in the asset use a custom ASE shader, and so cannot be converted automatically to HDRP materials by the "Convert built-in materials..." option. I tried setting the material to use the "Standard" material, but still no success with the automatic conversion.

    I've tried to convert the materials myself, with a limited degree of success. One problem that remains is that the alpha/transparency on one of the materials just isn't right - it shows as blotches of grey, rather than transparency around the object:

    https://photos.app.goo.gl/LLQ1hbFe8mcG2tdq6

    The model, some seaweed as it happens, comes with 4 textures:
    • Diff
    • Gloss
    • Illum
    • Normal
    I'm trying, rightly or wrongly, to map those onto the HDRP Lit Shader:
    • Diff -> Base Map
    • Normal -> Normal Map
    • Illum -> Emissive Map
    I'm guessing it simply isn't that straightforward, and I'm going to have to do some manual tinkering with the textures themselves. Specifically, I understand that the alpha is part of the Base Map in HDRP, and that may not be the case with the Diff texture I have to hand. I'm not sure what exactly each of the 4 textures is doing, to understand how to apply the same effect in HDRP.

    Materials, shaders and textures are really not an area I have any experience with, so I wondered if anyone could help?

    I hope this all makes sense! I'm using Unity 2021.3.11f and HDRP 12.1.7. The asset in question is here: https://assetstore.unity.com/packages/3d/vegetation/plants/corals-2-179881.

    Thank you in advance for any thoughts!
     
  2. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    If you get a good solution, I would love to hear it too. One thing you could look at is Shader Graph. With a few basic tutorials I was able to do simple shader graphs. What it might allow is faster experimentation - you can take a texture, split it into channels, then feed different channels into alpha etc yourself without redoing the textures. I managed to do this for some assets I got from the store. I am still learning it all myself, but very simple shader graph was relatively easy from zero knowledge (and some good YouTube tutorials!) Just wanted to raise it as an option.
     
    mroshaw likes this.
  3. mroshaw

    mroshaw

    Joined:
    Oct 11, 2020
    Posts:
    47
    Hello and thank you so much for the response! Yes, that sounds like a good idea. I've messed around with FX Graph, so hoping that Shader Graph is similar in its approach. For this particular instance, I was able to set the "Alpha Clipping" checkbox on the material, after changing the shader to HDRP Lit, and it greatly improved the look of the materials. I will continue to dabble!
     
  4. Freakish

    Freakish

    Joined:
    Jun 3, 2015
    Posts:
    81
    Yes it's a bit of a mess, you can make your own shadergraph that has options like Metallic and Smoothness options available, but by default the included HDRP Lit shader doesn't have these options exposed.

    The idea is that for optimization you are meant to pack textures like Roughness/Smoothness and Metallic, into a single Detail or Mask map, via the RGBA channels.

    https://docs.unity3d.com/Packages/c...tion@10.2/manual/Mask-Map-and-Detail-Map.html

    You either do that in a Image Editing app like Photoshop/Gimp or find a texture packer plugin:

    There are some free texture packer tools in the store, and also on GitHub.
    https://github.com/andydbc/unity-texture-packer

    The above is a free one, just grab the .zip file and copy the contents across to your project, from there you just add the old textures into the relevant channels (as per the Manual link above).

    You put the relevant maps into the desired channels, and the packer will output a single map that you then use in the Detail Map or Mask Map HDRP shader.

    It's not particularly intuitive, and creates several more steps than was previously needed, but it works...

    Hope it helps a bit.
     
  5. Enigma229

    Enigma229

    Joined:
    Aug 6, 2019
    Posts:
    135
    I’m assuming it did not come with an HDRP support package?