Search Unity

Metallic Workflow clarification

Discussion in 'General Graphics' started by Tarrag, Oct 14, 2019.

  1. Tarrag

    Tarrag

    Joined:
    Nov 7, 2016
    Posts:
    215
    Hey all

    Documentation says Metallic levels for the material controlled in the Red channel and smoothness by the Alpha channel, in each case of the texture.

    Why do we have Smoothness Source Albedo Alpha and Metallic Alpha? Metallic Alpha doesn't make sense if we say metallic is in the Red channel. I can't ignore this setting because using one of the other has an impact on the material result.

    Also, when I use a darker gray color on the alpha channel of Metallic map, the material darkens - but I would have thought it should only affect the smoothness and not the color tone?

    Can someone please shed some light?

    Thanks a bunch!
     
  2. Tartiflette

    Tartiflette

    Joined:
    Apr 10, 2015
    Posts:
    84
    "Metallic Alpha" refers the alpha of the texture that defines the metalness (not the alpha of red, which would indeed make no sense). Basically you can choose to have smoothness stored either in your main texture or in some secondary texture that also stores metalness.
    If you go for the secondary texture approach (which I personally always use), its format should be Smoothness (Red), Occlusion (Green, optional), Detail mask map (Blue, optional), Smoothness (Alpha). Because everything is packed in the way that unity expects it, you can put this one texture into the occlusion and detail mask slots if you want to.


    Regarding the darkening it might just be something specific to your scene lighting. As you make the material rougher the reflections will become softer and dimmer, which means potentially darker in some places. A screenshot would help.
     
  3. RendergonPolygons

    RendergonPolygons

    Joined:
    Oct 9, 2019
    Posts:
    98
    Hey @Tartiflette thanks for this. I am going to try this and get back :)

    If I may clarify, you mean don't add any texture map to the Metallic map slot, but add texture map to the Occlusion Texture map with R(Metallic), G (Occlusion), B (Detail Mask) A (Smoothness) ? Then the Unity documentation falls quite short :(

    With the above setup I am guessing I can use the metallic and smoothness bars to set the metallic and smoothness desired levels too ?

    Thanks a bunch for your help, Sergio
     
  4. Tartiflette

    Tartiflette

    Joined:
    Apr 10, 2015
    Posts:
    84
    No you put that texture with all the channels into the metallic map slot, the occlusion slot (if needed), and the detail map slot (if needed, but you probably don't). It's basically a multi-purpose texture.
     
  5. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    It should be noted the Standard shader's detail mask uses the alpha of the texture supplied, not the blue channel. The above packing only works with custom shaders where you've defined the packing yourself.

    Otherwise Metallic (R), Occlusion (G), Smoothness (A) does work with the Standard shader. Optionally you can store the height map used for parallax offset mapping in the green channel.
     
  6. RendergonPolygons

    RendergonPolygons

    Joined:
    Oct 9, 2019
    Posts:
    98
    That's clear now @Tartiflette @bgolus , very helpful and poweful to reduce map weights :)

    Thanks a bunch for your help !