Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Standard Shader Dull Compared to Legacy Bumped Diffuse

Discussion in 'Shaders' started by Zullar, Jun 23, 2016.

  1. Zullar

    Zullar

    Joined:
    May 21, 2013
    Posts:
    651
    I'm looking for help on why the Unity Standard Shader appears so dull/flat/low contrast compared to Legacy Shader/Bumped Diffuse when using the same texture & normal. (see picture)

    I am using Yughues cobblestone textures/normals from here.
    https://www.assetstore.unity3d.com/en/#!/content/12957

    The pack comes with a material with LegacyShader/Bumped Diffuse which looks very good. I made a standard shader with the same Albedo Texture & Normal Texture... but in game it seems extremely dull compared to the legacy shader. (Long story but I need standard shader, not legacy shader, to work with a script)

    I changed textures to truecolor, and set ANISO to 9 and it doesn't seem to improve it. Adjusting metallic/smoothness/normal map magnitude also doesn't improve it.

    Any advice on what I'm doing wrong with the standard shader would be appreciated. Thanks in advance.
     

    Attached Files:

  2. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    realism
     
    Martin_H likes this.
  3. Zullar

    Zullar

    Joined:
    May 21, 2013
    Posts:
    651
    Anybody else who's not a troll have any tips? No matter what I can't seem to get the Standard Shader to look good like the Legacy Bumped Diffuse.

    I feel like I must be missing something... the new improved shader shouldn't be worse... but it's foggy, whited out, and not crisp with detail and contrast like the legacy shader.
     
  4. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    That's not a troll, it's the reason it's not as vivid, that or you must check to see if you have the proper lighting format (linear and gamma). You should learn a bit about PBR lighting you would know.
     
    Martin_H likes this.
  5. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    Unity's Standard shader is based on the idea of PBR, or Physically Based Rendering. What that means is it's trying to more accurately simulate the real world behavior of surfaces. Because of that there are two key things that make the Standard shader with Metallic and Smoothness set to zero look different than the legacy Diffuse shader; specular and rough diffuse.

    Specular:
    The Standard material always has a least a little specular. Metallic set to zero doesn't mean the same as specular zero, rather it means a specular color of roughly RGB 56, 56, 56. This might seem weird, but everything in the real world has a little bit of specular, even things we think of as being purely diffuse. Most of the time they're far more shiny than we realize. So the metallic value is blending the specular color from that 56, 56, 56 at 0.0 to the color of the albedo texture at 1.0 (and even then actually only the albedo RGB color * ~0.96).
    There is an easy work around for this if you want to use the standard shader though. Use the "Standard (Specular setup)" shader instead and set the specular color manually to black. This is in fact essentially what Unity does if you use the legacy diffuse shader with the deferred rendering path as the deferred path can only render the Standard lighting model in deferred, everything else gets rendered in forward.

    Rough Diffuse:
    In the real world rough surfaces don't act like lambert diffuse, the diffuse lighting model that's been used in computer graphics for decades now and used by the legacy diffuse shader. In the real world rough surfaces tend to light much more flatly, and kind of blandly. Oren-Nayar is a popular example of diffuse lighting model that tries to more accurately model that "flatness".
    Unity's Standard shader does not use Oren-Nayar, it instead uses the so-called "Disney Diffuse" which is a diffuse model that Disney Animation Studios came up with, but the results are similar. However both Oren-Nayar and Disney Diffuse have one thing in common, at a roughness of 0.0 (or in Unity parlance, a smoothness of 1.0) they both look nearly identical to lambert.
    If you set the smoothness on the "Standard" shader to 1 the specular highlights will for the most part disappear because they get nearly infinitely sharp making them effectively disappear and the diffuse lighting looks almost like the legacy diffuse shader! You'll also get get shiny reflections if you have a skybox or reflection probes, and you might get super bright pixels, often called "fireflies", flickering on the surface when that nearly infinitely small specular highlight does show. However if you have already switched to the "Standard (Specular setup)" shader and set the specular to black those specular highlights won't show up! The specular reflections will still though, so you can't use reflection probes and you'll want a black skybox or override the reflection source with a black cubemap in the lighting panel.

    Ultimately if you like the look of the Legacy Diffuse shader, just keep using the Legacy Diffuse shader. It's much cheaper and generally better for non-realistic looking art styles.
     
    Zimbres, mandisaw, Ruslank100 and 4 others like this.
  6. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,436
    That was very informative, thank you very much!



    These links might be relevant to the OP as well:

    http://forum.unity3d.com/threads/official-5-0-pbr-calibration-charts.289416/
    https://www.allegorithmic.com/pbr-guide
     
  7. Zullar

    Zullar

    Joined:
    May 21, 2013
    Posts:
    651
    The Legacy Bumped Diffuse shader doesn't seem to work with shadows so I am forced to use the standard shader.

    However I did exactly what you said and used the Standard (Specular) shader instead of Standard. This allows me to completely turn off the specular to 0,0,0 (instead of 56, 56, 56). This really brought back the contrast and got rid of the white-out dullness generated by the Standard shader's 56, 56, 56 specular.

    So in summary
    -Legacy Bumped Diffuse = Standard (Specular) w/ Specular Set to 0, 0, 0 (Crisp w/ contrast)
    -Standard = Standard (Specular) w/ Specular Set to 56, 56, 56 and smoothness = 0 (Dull and whited out)

    Thanks a lot for the help guys.

    Moral of the story: Never use Standard shader? Standard (Specular) can do everything Standard can do as well as be able to adjust to less than specular 56, 56, 56 in order to sharpen up contrast.
     
    Zimbres and Cam_Crichton like this.
  8. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    Standard (with Metallic) makes it a little easier to create real-world plausible materials, where Standard Specular let's you create materials that are somewhat outside the common materials or make materials that stretch plausibility. Using the metallic mask can also be a little simplier to setup. But you are correct that the everything the Standard shader can do the Standard Specular can as well.
     
    Zullar likes this.
  9. Zythus

    Zythus

    Joined:
    Jun 28, 2014
    Posts:
    30
    Which one is more mobile friendly? I like the Mobile -> Bumped Specular attached to a building, and was wondering if there is a big difference in performance when using it over Standard shader.
     
  10. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    The mobile specific shaders will be a bit faster. If you don't need the additional realism of the Standard shader they're a good option.
     
    Zullar and Zythus like this.
  11. Zullar

    Zullar

    Joined:
    May 21, 2013
    Posts:
    651
    I started using the Terrain component and face the same issue again.

    The Terrain component options are:
    1: Built In Standard (Shadows work, but it's dull and whitewashed)
    2: Legacy Diffuse (Shadows don't work, but the contrast is crisp)
    3: Legacy Specular (Shadows don't work, but the contrast is crisp)
    4: Custom

    So looks like I must use option #4 custom because options #1, #2, #3 have issues.

    If I try to assign the StandardSpecular shader I get this warning in the Terrain component: "Can't use materials with shaders which need tangent geometry on terrain, use shaders in Nature/Terrain instead."

    Looking at Nature/Terrain there are three options to apply as a custom shader
    A: Nature/Terrain/Standard (Shadows work, but it's dull and whitewashed... same as option 1 above)
    B: Nature/Terrain/Diffuse (Shadows don't work, but the contrast is crisp... same as option 2 above)
    C: Nature/Terrain/Specular (Shadows don't work, but the contrast is crisp... same as option 3 above)

    Does this mean I must write my own shader if I want Terrain that...
    -Has shadows
    -Isn't dulled and whitewashed by the standard shader?

    I feel like I must be doing something wrong.

    Thanks in advance.
     
  12. Gua

    Gua

    Joined:
    Oct 29, 2012
    Posts:
    455
    @Zullar, are you using Deferred rendering path?
     
  13. Zullar

    Zullar

    Joined:
    May 21, 2013
    Posts:
    651
    I have Edit --> Project Settings --> Graphics: Deferred = Built-in shader

    Why do you ask?
     
  14. Gua

    Gua

    Joined:
    Oct 29, 2012
    Posts:
    455
    Previously I thought that this is Deferred specific problem, but now I know that it isn't.
     
  15. Zullar

    Zullar

    Joined:
    May 21, 2013
    Posts:
    651
    Really wish you could actually set smoothness to 0.

    The same issue carries over to the Particles/Standard Surface shader as well. Even if you set smoothness to 0, it still has the smoothness of ~20% and reflects. It looks like it has a dulll Albedo and shiny.

    IMO they should let you drop smoothness < 20% and just throw an inspector warning stating that no real material has a smoothness < 20%... as opposed to completely locking you out from this.
     
    Ruslank100 and Martin_H like this.
  16. Zullar

    Zullar

    Joined:
    May 21, 2013
    Posts:
    651
    Update 2018.3.0f2: It looks like there a few solutions to this issue now.

    It seems there are a few workable options for terrains now that do not produce dull looking terrains.
    Option 1: Built In Legacy Diffuse: Works great and is not dull (shadows are working now)
    Option 2: Built In Legacy Specular: Works great and is not dull (shadows are working now. Set Specular Color black)
    Option 3: Custom: Allows you to use "Nature/Terrain/Specular" which is also not dull if you change Specular Color to black

    -NEVER use "Built in Standard"... for anything... ever! It's always dull due to inherent specular that can not be turned off.