Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Standard shader confusion

Discussion in 'Unity 5 Pre-order Beta' started by Brenden-Frank, Nov 13, 2014.

  1. Brenden-Frank

    Brenden-Frank

    Joined:
    Aug 5, 2012
    Posts:
    110
    Hey guys,

    I'm confused about specular with the standard shader. If I enable default reflection in the rendersettings I get a "fresnel" effect on all my objects. I can curtail this by reducing the specular color and limiting smoothness. When I add a specular map however, it doesn't seem to matter how dark the spec map is, it gets full blown fresnel.

    The smoothness slider is gone and as is the spec color; I'm assuming because the map should naturally be able to cover what those parameters do anyways but a black texture is not giving me the same result as a black specular color. Anyone encoutnered this or have any suggestions on how I'm going about this?

    Thanks,

    Brenden
     
  2. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    If you assigned a specular map, you automatically assign a smoothness map as the specular map's alpha channel. So, if you want only rough materials, make the alpha channel of your spec map black.
     
  3. Brenden-Frank

    Brenden-Frank

    Joined:
    Aug 5, 2012
    Posts:
    110
    Thanks that clears up a lot. There's still quite a bit of issues if a cubemap is set for default reflectivity though. The shader seems to ignore the specmap and make the object "glow"; any thoughts on that?
     
  4. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Can you attach a picture of your issue? I can't really follow your description.
     
  5. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    i think it's better if you wait for beta 13, it has a lot of changes regarding shaders and contains a metallic workflow too
     
  6. Brenden-Frank

    Brenden-Frank

    Joined:
    Aug 5, 2012
    Posts:
    110
  7. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Your specular looks like it's too high (which makes the material look like metal). Set it to like a 4% grayscale fill.
    You also should read up on Physically Based Shading, particularly the articles on the Marmoset website.

    Here's a couple of key concepts:
    • Everything is shiny.
    • Everything has fresnel.
    • If the diffuse is bright, the specular is not. Conversely, if the specular is bright, the diffuse is not. (diffuse and specular added together should never be more than 1.0)
     
  8. Brenden-Frank

    Brenden-Frank

    Joined:
    Aug 5, 2012
    Posts:
    110
  9. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Those bluish parts? I'm not sure that's fresnel. If it's actually fresnel, try setting your smoothness to a darker value.
     
  10. Brenden-Frank

    Brenden-Frank

    Joined:
    Aug 5, 2012
    Posts:
    110
  11. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    So those "lit" parts, is that cubemap reflection? If that's the case you need to re-work your specular maps.

    EDIT: And by "rework" I mean pretty much just flood fill 4% grayscale. That's at least a good starting point for almost any non-metal surface, and almost all variation should be in the smoothness rather than the specular color.
     
  12. Brenden-Frank

    Brenden-Frank

    Joined:
    Aug 5, 2012
    Posts:
    110
    When I flood it that dark then I get no specular pretty much at all. If I make the roughness anything but near black I get the crazy fresnel effect as shown above.
     
  13. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Yeah, that looks really weird. Make sure your normal map is set as normal map in the import settings.
     
  14. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    In fact, try removing the normal map altogether just to eliminate that as a factor.
     
  15. Brenden-Frank

    Brenden-Frank

    Joined:
    Aug 5, 2012
    Posts:
    110
  16. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Try placing a reflection probe right in front of that rock. Maybe it's the bluish color that makes it look so weird, and if it starts reflecting the actual environment around it, it will look better?
     
  17. Brenden-Frank

    Brenden-Frank

    Joined:
    Aug 5, 2012
    Posts:
    110
    That certainly tones down the shadowed areas but the larger problem remains that there's nearly no specular on the lit portions of the object.
     
  18. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
  19. p87

    p87

    Joined:
    Jun 6, 2013
    Posts:
    318
    better yet just post the rock and your textures...
     
  20. Brenden-Frank

    Brenden-Frank

    Joined:
    Aug 5, 2012
    Posts:
    110
    Reflection intensity --added in beta 13 was the solution to my problem. Thanks for all your help guys!