Search Unity

Standard Shader (Roughness Setup), Smoothness controlled from two maps?

Discussion in 'Shaders' started by iSinner, Aug 23, 2019.

  1. iSinner

    iSinner

    Joined:
    Dec 5, 2013
    Posts:
    129
    Unity's "Standard (Roughness Setup)" shader has two slots that are confusing
    A slot called "Metallic" with a tooltip that says that it expects Metallic in R channel and Smoothness in R channel,
    A slot called "Roughness" with the tooltip "Roughness value".

    Can someone explain how the same thing, smoothness, can be controlled from both places, the A channel from the metallic map and a roughness map from the Roughness channel.

    Roughness is 1-Smoothness, so how do they play together?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    7,146
    Easy. It's a typo.
    The alpha of the Metallic map is ignored when using that version of the Standard shader, but the tooltip text was copied verbatim from the other Standard shader types.
     
    iSinner likes this.
  3. iSinner

    iSinner

    Joined:
    Dec 5, 2013
    Posts:
    129
    Why did they allow for roughness to be set from both places, isn't one enough?

    Is this a side effect of them trying to make it similar to some other shader? (i know they tried to make it similar to some shader from a DCC tool)
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    7,146
    I mean, they allow smoothness from the alpha of the metallic, specular, or albedo maps.

    Roughness is only ever from that one source. And yes, it’s for compatibility with DCC tools, most of which use a separate roughness texture rather than using channel packing. They even renamed “Standard (Roughness Setup)” to “Autodesk Interactive” in 2018.3 to hammer that home.

    Really, you should not be using the roughness setup for anything where performance is your main goal.
     
    iSinner likes this.