Search Unity

Unity should add a Fix button when connecting a Metallic, Roughness and Specular maps to the shader

Discussion in 'General Graphics' started by Linkooo, Nov 15, 2017.

  1. Linkooo

    Linkooo

    Joined:
    May 16, 2016
    Posts:
    29
    Blender and other modeling software use the Metallic, Roughness, Smoothness, Specular maps in Linear color space but Unity reads everything in sRGB. I suggest that when we connect a Metallic, Roughness and Specular map to the shader a Fix now button appears like for the normal map. When clicked it uncheck the texture setting "sRGB (Color Texture)".

    This would avoid to make mistakes by having a different PBR look between the modeling and texturing software and the game engine and have a shader that don't look physically correct if we work with real PBR values.
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,343
    Smoothness (which is 1 - Roughness) is stored in the alpha channel, which is always treated as linear. Metallic should generally only ever be 0.0 or 1.0, and neither gamma or linear is really any more correct than the other for handling the bilinear interpolation between. Additionally, assuming you're using the Principled shader in Blender, the Specular value in Blender and the Specular in Unity are not the same thing at all, they are completely unrelated. Unity has nothing like the Specular or Specular Tint values in Blender. Similarly I don't believe Blender has anything like Unity's Standard Specular shader.

    Also note that the "fix now" button for normal maps does more than uncheck the sRGB setting, it additionally sets it to be a "normal map" texture type which does a bit more work to the texture behind the scenes to the texture. However the normal map still needs to be in the correct format to begin with. If the Y (green channel) is flipped or the normal map was saved in the wrong color space, Unity isn't fixing any of that.

    Basically Unity makes no assumptions about where the data is coming from, it's up to you to make sure it's in the layout and format Unity needs.
     
    theANMATOR2b likes this.
  3. Linkooo

    Linkooo

    Joined:
    May 16, 2016
    Posts:
    29
    Hi,

    I don't use the specular value of the principled shader but the roughness value and in Unity I only use the shader in the mode Standard (Roughness setup). I have the same result between the two once I convert the texture in Unity as Linear but sometimes I forget to fix the color space.

    About the green channel flipped, Blender is in OpenGL and Unity too so I will never encounter this problem.