Search Unity

directional Specular baking issue

Discussion in 'Global Illumination' started by rubiez64, Aug 7, 2016.

  1. rubiez64

    rubiez64

    Joined:
    Jul 25, 2016
    Posts:
    26
    hi guys,
    I'm new to the baking of unity and I stumbled up on this problem, where the specularity and normal of the surface gets distorted in a weird way(see images below).

    I spent couple of days trying to solve it, but no help... even in forums...
    it has to do something with the metallic and smoothness values of the baking, because when i bring it down to 0, the problem goes away, however, I do need the shine of the metal.

    anyone here can help me?

    thank you in advance ^_^



     
  2. francksitbon

    francksitbon

    Joined:
    Jan 22, 2010
    Posts:
    268
    Looks like something reflection.
    Try to disable reflection probe and see what happens
     
  3. rubiez64

    rubiez64

    Joined:
    Jul 25, 2016
    Posts:
    26
    no reflection probes in the scene, all objects are static, and the lights are set to mixed... setting them to bake only, doesnt resolve the issue :(
     
  4. francksitbon

    francksitbon

    Joined:
    Jan 22, 2010
    Posts:
    268
    try to disable all lights after baking and see what happens
     
  5. rubiez64

    rubiez64

    Joined:
    Jul 25, 2016
    Posts:
    26
    nop... still the same...

    I think you can reproduce this if you take a surface, and make it 0.5 smooth and 0.8 metallic, then bake directional specular with a point light, you will get this result
     
  6. rubiez64

    rubiez64

    Joined:
    Jul 25, 2016
    Posts:
    26


    here's another scene, completely new, with two point lights after directional specular bake.
     
  7. Deleted User

    Deleted User

    Guest

    result2.JPG result.JPG Its not only you, It looks like the directional map is changing the surface normals of the object. my bake, was in a new Unity 5.4 project, with only unity assets(Cube and Quad mesh) all lights baked, and all meshes lightmap.
     

    Attached Files:

    Last edited by a moderator: Aug 9, 2016
    rubiez64 likes this.
  8. rubiez64

    rubiez64

    Joined:
    Jul 25, 2016
    Posts:
    26
    So... should we highlight this post? or pin it? or submit it as a bug report?
    how do we get the unity developer team notice it?
     
  9. Deleted User

    Deleted User

    Guest

    They usually read this forum, checking new posts, can try to ping @KEngelstoft
     
    rubiez64 likes this.
  10. Deleted User

    Deleted User

    Guest

  11. rubiez64

    rubiez64

    Joined:
    Jul 25, 2016
    Posts:
    26
    Well... that's one way to fix it X_X
     
  12. Kuba

    Kuba

    Moderator

    Joined:
    Jan 13, 2009
    Posts:
    416
    The Directional Specular mode was introduced before Reflection Probes and SSRR existed in Unity. It really only has enough storage to keep information on a general light direction and on whether the incoming light is coming from one well defined direction or if it's more ambient.

    That means that areas with multiple overlapping lights are problematic. The direction can suddenly change over a few texels and that can mean that areas where you'd still expect a certain specular highlight to continue will not have one, as the interpolated direction for multiple lights gives the highlight for a different viewing angle than the current one.

    Also, even with just one light the shadow edges were tricky, as going from light into the shadow you are effectively going from an area with a well defined direction to an area with quite an arbitrary direction (best case: a direction pointing somewhere into the sky, in case of an outdoor scene). Those borders were initially incorrectly shiny almost no matter the viewing direction (they behaved as if the geometry was embossed), but luckily that was fixed with some clever filtering.

    Joachim's right that going forward reflection probes and SSRR are what should be used for the specular contribution (see the post linked to above). Additionally, we will experiment with the specular directional occlusion to properly attenuate information coming from reflection probes.
     
    AcidArrow and Pawige like this.
  13. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,746
    That makes sense.

    Specularity -> Reflection of light, so current methods for reflections should cover that. The advantage that traditional specularity has is the precision, but the Directional Specular mode quickly lost "precision" making it a bit useless. It's not that the Unity implementation is buggy, it's that the method in general is a bit flawed and you really have to set up your scenes around it in order for it to look right.

    I'm digging the direction Unity is going with the lighting. If the progressive lightmapper is also everything I hope it it will be (I guess I'm setting up myself to be disappointed though :p ), I'll be a happy camper.