Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

Unity 5 PBR weak spots [example scene included]

Discussion in 'General Graphics' started by Lex4art, Oct 16, 2015.

  1. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    419
    Greetings. While creating materials for standard shader i'm encountered some problems that still (after 6+ months since Unity 5.0.0 was released) present even in latest 5.2.x builds. If Unity team can fix them that's will make my material work way more pleasant :) (here example map - 97Mb, required Unity 5.1 or higher + linear space lighting). Unity 5 has good cubemap reflection system (resolution can be set up to 2048px compare to UE4 with cheap 128x128px cubemaps), just need some polishing.

    1)Reflective materials looks patchy even if smoothness map is ... smooth. Here comparison shots from Unreal Engine:

    Reason for that, i guess (i'm not programmer) - is how standard shader computes reflection smoothness. Let's create an plane and apply uncompressed metalness material with gradual smoothness in alpha channel:

    An explanation of what we see here:

    As result of that fast blur algorithm we got that spotty look:

    E.g. no really smooth transitions for reflections, there steps that's gives that cheap material appearance. Looks especially bad were sun highlight boosts that "mip-step" reflection.

    2)Second problem - microscopic highlights on materials with high smoothness value. On image below you can try to find highlight from directional light entity:

    Right answer:

    Mirror-like materials looks really wrong if there no highlight visible from lights around...

    3)Smoothness incoherency. Both of this spheres has same material - that makes them look different is reflection probes size (left one affected by 128x128px reflection probe, right - with 2048x2048):

    E.g. materials has floating smoothness because of that and really hard to make them look correct for universal usage:


    (sorry for ugly gray old shots!).

    Hope this dig will be useful ;). Skybox HDRI on first shots - from http://noemotionhdrs.net/
     
    Last edited: Oct 16, 2015
  2. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    *cracks knuckles*
    I'll chime in on a few of these.
    1). Some of what you're seeing is a result of the differing BRDF/Roughness mapping of the SS vs. UE4. The same roughness map values will not give the same results. Unity has said this will change in 5.3
    The mip-stepping you're seeing is inherent to the way reflection probes (and any pre-processed cubemap works). You will never have a flawless and accurate transition between mip-steps. All it can do is interpolate. This will be the state of things until something like importance sampling (ie what substance designed/painter does) becomes realtime tenable.

    2). The microscropic highlight is because someone at Unity thought that a roughness range that goes up that high was useful. If you don't like that tight of a highlight, don't max your smoothness.

    3). Yup, major problem with reflection probes. My understanding is that one gets around this by simply choosing a _consistent_ size for all reflection probes for a project, and author your roughness maps to match the behavior at that rez. No other way to deal with it currently.
     
    theANMATOR2b and Lex4art like this.
  3. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    419
    Yes, i noticed that - after simple inverting metalness map (UE4 uses black for totally smooth surface) got different looking material:

    So, i shift brightness of roughness map for UE4 to the point were blurriness of objects reflected in this copper sphere becomes similar to Unity's one - this corrected version is used in first post...

    Well, i didn't believed in that, open my old cryengine 3.5.8 project and... got same result with gradient glossiness map. In UE4 - same (but harder to see because of 128x128px cubemaps with laaaarge pixels). Sir, you're right!


    Smoothness value lowered until sun highlight becomes same sized as photo reference on top left. But blurriness kicks in (that's a eeeevil joke from Unity dev's: we have up to 2048px reflection probes but can't use this power properly XD).

    That's how it's made in UE4.x or Cryengine 3.6+ - at an internal programmers summit they decide that "128px/256px cubemaps is enough for anyone" and stone age begins (Source engine level of reflection size) - a lot of materials (glass, polished metals/granite, glossy plastic, water and so on) looks real only then they has razor sharp reflections...

    Also tomaszek recommended check GGX specular highlights/reflection mode and Mikael G, fortunately for me, already made this possible - testing this stuff right now.
     
    Last edited: Oct 19, 2015
  4. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    419
    [UPDATE] Good news http://forum.unity3d.com/threads/ggx.360890/#post-2352055 - GGX specular & some other improvements may appear in Unity v5.3

    Heh, GGX did it - with proper look of sun highlight copper feels like copper:

    With blurry FXAA (slightly reduces steps of mip-map reflections, same as TXAA in UE4) + chromatic aberrations + HDR (Photographic preset) it's finally close enough to UE4 ).

    Upd: more of this

    Seems that GGX mode requires shift in smoothness maps of all my matte/semi matte materials (looks too smooth compare original), but if someday GGX comes as standard to Unity - will do it for all my stuff in asset store; or that can be automatically processed on metalness maps then project imported to this Unity version).

    [UPDATE] Good news http://forum.unity3d.com/threads/ggx.360890/#post-2352055 - GGX specular & some other improvements may appear in Unity v5.3
     
    Last edited: Oct 23, 2015
unityunity