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

Weird PBR results

Discussion in 'Unity 5 Pre-order Beta' started by Devil_Inside, Oct 29, 2014.

  1. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,119
    I was fiddling around with the Standard shader trying to recreate the same looks I get in Marmoset Toolbag and Quixel Suite, but I just couldn't make it work.
    It seems there is some issues with how the glossiness (smoothness) value is processed. I'll attach 3 screenshots to illustrate the problem.
    The first screen is from Marmoset Toolbag, note how reflective is the gun metal.
    PBR_1.jpg
    The next image is from Unity, using the same environment and having the light direction adjusted. Note how dull the metal is. There are parts that are still very glossy, like the reflective edge on the part, covering the cylinder, the rest is very very rough and doesn't look like metal at all.
    PBR_2.jpg
    The next image, is exactly the same Unity setup, except now instead of using the built-in scene reflection, there is a reflective probe present, with a 512 resolution, which is higher than the built-in one. I don't really understand why the resolution of the probe has such a great impact on the image, but if I bring down the resolution of the probe to 128, I get exactly the same result as above. Still, even with a hi-res probe, the image is far from what I'm aiming for. The metal is dull and unreflective.
    PBR_3.jpg

    P.S. Another issue I noticed, seems to also be related to smoothness. The transition between rough and smooth areas on the surface are too sharp. While in Toolbag and other apps the transition is blended and smooth, in Unity it's just too abrupt.

    P.P.S. I think there should be an option to make the default scene reflection be of a higher resolution.
     
  2. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,529
    What do your maps look like?
     
  3. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    It's possible that Unity's PBR setup is different than Marmoset's. Can you post the specular map it uses (or a screenshot of it)? (Don't violate the TOS to post this if that's a factor - I mostly am just asking if it's bright or dark) Include a shot of both the colors and the alpha channel of it, as both are used in Unity.
     
  4. ReJ

    ReJ

    Unity Technologies

    Joined:
    Nov 1, 2008
    Posts:
    378
    Try this patch (just drop all files from archive into your project). We've made Standard shader much much closer to Marmoset Toolbag2. These changes will appear in one of the betas soon.
     

    Attached Files:

    Devil_Inside and shkar-noori like this.
  5. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,119
    I tried the new shaders. In the same setup as above, the new shader is super bright. I used light intensity of 1 for previous screenshots, and with this intensity the new shader looks like this:
    PBR_4.jpg
    If I scale the light intensity down to 0.25, it starts to look much better, but seems to have too much contrast and the wood color is way off.
    PBR_5.jpg
    Here's s mall screenshot of my specgloss map
    PBR_SG.jpg
    Glossmap looks very dark, but I think it has somewhat to do with the previewer using sRGB correction to display the alpha map, and sRGB correction shouldn't happen in the shader.
     
  6. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,119
    So, do you guys have any suggestions?
    Right now it's kind of hard to author textures when the resulting material looks so different.
     
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    It looks to me like the smoothness values are interpreted as quite in Unity than in Marmoset.

    Can you try adjust the levels of the alpha map of the specular see if that makes it closer to the marmoset image?

    Also, I'm assuming you have HDR on on everything you can, right? (cameras, cubemaps etc)
     
  8. Roni92

    Roni92

    Joined:
    Nov 29, 2013
    Posts:
    225
    Very nice result on the last screenshot, but Im more concerned on how Unitys standard shader cooperates with Allegorithmic's tools ;) ( I mean how different the object will look in Unity compared to how it looked in substance painter)
     
  9. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,119
    I was able to achieve kind of the same look on the metal by turning down the brightness of the gloss map to 1/3rd of it's original value and setting the light intensity back to the default 0.5. But there still is something wrong with it, there is not enough overall contrast (the wood looks desaturated, and some of the metal parts need to be darker). I'll attach both the Toolbag and the Unity version for comparison.
    PBR_6.jpg

    I think the shader needs to be tuned a bit more, to increase the contrast and remove the requirement to turn down the brightness of the glossmap. It also needs to be tested on other examples.
     
  10. Roni92

    Roni92

    Joined:
    Nov 29, 2013
    Posts:
    225
    Hey would be awesome if someone could post screenshot of famous marmoset's scooter in Unity so we could compare ;]
     
  11. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    So far - at least for Substance Designer I found that the Diff/Gloss shader in Designer and unity were close but still somewhat different. unity's is a little darker and less shiny in direct comparison with the same maps but by far not as extreme as Devil_Inside's example.

    Then again I am still not entirely sure what I need to set in Unity to match the setup exactly.
    Does the scene have to be linear?
    Does it need to be DX11?
    Hoch much of a difference does the color depth and compression have on all the maps involved and where should no compression be applied at all?
     
  12. Roni92

    Roni92

    Joined:
    Nov 29, 2013
    Posts:
    225
    Hehe, you should read some on PBR subject, linear color space is a must with it :) ( if you want realistic outcome ofc )
     
    shkar-noori likes this.
  13. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Have you made sure your reflection probe is being baked in HDR?

    EDIT: I also had to darken my gloss map quite a lot to get things to look okay with that updated shader. Other than that, the increased fresnel looks pretty nice, but things do somehow look a bit more... plastic like.
     
    Last edited: Oct 30, 2014
  14. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,119
    Camera is HDR. Color space is Linear.
    There is no reflection probe by default as it uses the default skybox reflection (which is very low res), so I don't know if it's HDR or not.
     
  15. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Try placing a reflection probe in your scene and make sure it's HD then. I tried using my own reflection maps as well and they made things look really off, too.
     
  16. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,119
    I tried with a HDR probe, the change is so subtle, that it's barely noticeable. What has the biggest effect is the resolution of the probe.
     
  17. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Alright then, seems like we are having different issues then. I agree with your comment on the updated shader about the glossiness and contrast, though.
     
  18. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,119
    Ok, I'm an idiot.
    My color space was set to Gamma, probably changed it when I was trying to figure out why the default shader was so off.
    Now, with color space set to Linear, the new shader that ReJ posted works fine with the unmodified gloss map.
    Here are the results for comparison.
    It does look almost identical. The few tiny differences - from up close Unity one looks a bit blurry for some reason. Also note the sharp scratch on the cylinder as well as scratches on the trigger guard, they're much brighter in marmoset. Maybe it's the difference in camera angle though.

    Overall I'm pretty pleased with the new shader, hope it'll be added into the beta soon.
    PBR_7.jpg
     
  19. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    The perspective is a little different, so maybe that explains those last few differences.

    It looks pretty close in general. Glad you solved this.
     
  20. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,119
    Yeah, I've edited the post to say that it might be related to camera angle, but it didn't save the edit for some reason.
    I'm overall pleased with the new version of the shader, hopefully it will be soon available for everyone through a Unity beta update.
     
  21. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Odd, in that case, does someone have an idea why for me it looks like this? (the second image is part of my roughness map)



     
    minhdaubu2 likes this.
  22. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,119
    What's the difference between the two helmets?
     
  23. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    The helmet to the left uses the updated shader, the one to the right the regular standard shader.
     
  24. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,119
    Do you have your Color Space set to Linear?
     
  25. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
  26. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,119
    What's your light intensity? I used the default 0.5 for my scene.
     
  27. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    It's 0.8 but changing it to 0.5 does not solve it. Even then, I suppose it'd make sense for things to look consistent even with more or less intense direct light.
     
  28. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,119
    Do you have a reference to see how it's supposed to look?
     
  29. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    No, I "ported" this to be PBS for Unity 5. Thing is, though, the helmet has a smoothness value of 0.3-0.65. The way it looks with the regular standard shader is much closer to what I'd expect considering all the material recommendations around. Oh well, I guess I'll just have to hope it's not going to misbehave when it's released in a new beta version. Thanks for the help!
     
  30. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    I've made a comparison chart of my first tests for those interested.
     

    Attached Files:

  31. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,119
    The environment exposure in SD is too high for comparison. Try lowering it down.
    Right now the Unity linear space without post processing looks best to me.
    The last 2 screenshots have some artifacts on the bottom part of the cube, is that due to compression of the textures?
     
  32. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    The artifacts in the last two screens are due to normal map compression.
    Uncompressed normalmaps look absolutely smooth.

    The exposure being way higher in SD is also visible on the clouds, that's correct.
    Making the specular alpha a tad brighter also brings unity closer to SD.

    The chart was made made intentionally without much correction and tweaking to see just how close basic settings alone bring the two programs together and what experiences other users might have made with it.
     
  33. Roni92

    Roni92

    Joined:
    Nov 29, 2013
    Posts:
    225
    app always looks better with good post process. The problem with Unity is that it hasn't good PP :s
    Look at unreal screens, why they looks so good? Mainly because of great ppfx used, that Unity always lacks.
    Also, men, always use AA in apps, please :)
     
    Last edited: Oct 31, 2014
    shkar-noori likes this.