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

Unity 5 shaders low quality

Discussion in 'Shaders' started by zenGarden, Mar 25, 2015.

  1. Deleted User

    Deleted User

    Guest

    @Allegorithmic
    You are partially correct in that the different Visibility functions don't make much of a difference here. However, the different Distribution functions make a huge difference. Unity choosing Blinn Phong while just about everyone else chose GGX means that the highlights will never match up even when they use similar roughness inputs. This is the single biggest reason why they will end up looking different no matter what.
     
  2. Deleted User

    Deleted User

    Guest

    For anyone that cares, I've added two posts to G.Mika's GGX Standard shader thread with some notes on how to make some simple, shallow changes to the Standard shader to dramatically improve the transfer quality from the Substance tools to Unity's Standard shader:
    Using GGX instead of Blinn-Phong

    Or, maybe you could just use Alloy. Just saying. ;)
     
    AcidArrow likes this.
  3. Allegorithmic

    Allegorithmic

    Joined:
    Apr 1, 2015
    Posts:
    11
    Hi n00body ,

    No problem at all : ) Your post was great and very informative. You did exactly what was needed which is to get good and correct info about PBR to the Unity community. We just wanted to add some additional information that was specific to Substance as well. We agree with you guys : ) I sent your first post to our engineers to see if there was anything they wanted to add in regards to Substance for the Unity community.

    I definitely agree that the single biggest issue is the distribution functions. Thanks much for adding the notes on how to improve the transfer quality from the Substance tools to Unity's Standard shader in the GGX standard shader thread.

    I haven't been able to get Unity to confirm next steps in terms of updates to their shader. Last we were told, they would be re-implementing ggx as a desktop shader and removing the gloss curve they are applying to smoothness. I think they removed or tweaked the gloss curve in 5.01p2 but I haven't confirmed.

    In my personal opinion, I think that Alloy is the best option for PBR in Unity and a great workflow for Substance.

    Cheers,

    Wes
     
    xenius and Deleted User like this.
  4. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    This is why not relying on Unity shaders is a better option. Using Alloy shaders for UT5 and Substance Painter we keep the exact same look for 3D assets on both software and we are not depending on Unity weak shaders or constant changes.
     
  5. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Why every community, for every piece of software I know, needs to have a HATER that hates that software with his whole body and soul, yet he continues to use that software, and he keeps on picking at that software at every opportunity, repeating himself over and over again?
     
  6. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    I don't see it quite that way, at least not from the post you responded to. It seems like simple prudence to me to find the tool that works best, and to use it.

    Unity's doing a great job in moving forward with U4.6, U5, and the coming U5.1. Those updates have a ton of excellent free features for people who are just getting started to use.

    If, however, you are married to substance and you want to be faithful to it, probably best to go with Alloy since they make it a special goal to stay current with substance.
     
  7. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Yeah, except he said it 3 times already in this single thread. And in all the other threads he doesn't miss the opportunity to remind everyone that unity sucks. This is freaking annoying.
     
    Dantus likes this.
  8. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    This is your ideas that are haters against people :rolleyes:
    I use Unity and some plugin systems to make games and it is just great as always.

    I have the right to bring critics and bad ones about Unity not bringing good PBR shaders look after more than one year working on it. And like for UT4 Unity relies a lot on the Asset Store if you need tools like :
    - Vertex painting
    - cinematic camera system
    - lot better terrain
    - visual programming
    and many others essential needs.
    But let's stay on track.

    Alloy braught quickly great quality. As 3D artist like many others we seek quality PBR and flowless workflow between a 3D engine and a painting software.
    If it was Unreal or Crysis engine and bad PBR rendering compared to Unity, we would just say the same bad critics in their forums.

    Don't read all my threads.
    Im' just very surprised Unity to not be more collaborative with Substance or not trying to improve PBR to have rendering PBR looking more right and less specular everywhere.
    It's just my opinion on the subject, i'm not attacking Unity, and i'm not the only one saying Unity today PBR rendering is not so great.

    And pointing some PBR rendering problems is always good then just not saying anything, otherwise you won't have Unity improving them before a long long time :rolleyes:
    Critics are not against your beloved and favorite 3D engine, it's more some hiddend request for Unity in the message :D

    Have a nice day.
     
  9. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    226
    I know this is an old thread, but has anything changed since May? I can't find anything on the roadmap regarding improving the PBR in unity.
     
  10. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    What exactly do you mean?
    The main issue as mentioned in this thread is that textures created in the Substance Designer don't look identical in Unity. This is not a Unity issue, but needs to be resolved by Allegorithmic.
    There are some aspects that can be improved by Unity, especially as mentioned here:
    http://forum.unity3d.com/threads/using-ggx-instead-of-blinn-phong.323827/#post-2103011
     
  11. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    226
    I see. For some reason I was under the impression this is a Unity issue (at least partly).
     
  12. Deleted User

    Deleted User

    Guest

    @zyzyx
    It is partially a Unity issue, since Unity decided to buck the industry trend and go with their own material model and input mappings. I feel like Unity should be giving Allegorithmic more info on how their shaders handle inputs so that they could come up with an export option that would work.
     
  13. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    I'm not sure there is a trend. And Unity wasn't the first, was it?
    The first was Marmoset Toolbag 2, which is used by a very large number of artists. So it kind of made sense to make a shader compatible with a tool used by a large number of artists.
     
  14. Deleted User

    Deleted User

    Guest

    @Devil_Inside
    I suppose when Unity 5 was still forming it was hard to gauge which mapping would be the best choice. At the very least, I wish they had better explained the options they left in the Standard shader to enable a mapping and BRDF that is more friendly to the Substance tools. The code is there and it is easy to make the change, but very few know about it.
     
  15. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    What really boggles my mind is that with such a tight relationship with Allegorithmic they can't come up with a way to make a proper integration: Either write a "Unity" shader for Substance tools or make a proper "Unity" export profile.
     
  16. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Right now, there is no industry standard and Allegorithmic is well aware of it. The textures created in Substance Designer, will never match 100% in any other application and everyone is or at least should be aware of that. The main issue is that they pretend to support Unity 5, meaning the results in Unity should look almost as expected. Unfortunately that is not the case.

    I don't know whether Unity doesn't share the necessary information with Allegorithmic and at the end it doesn't matter. If I create software and I am advertising to support Unity 5, it would make a lot of sense to actually doing that.
     
  17. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Unity felt that their own choices would trump what others did. It might have if it wasn't butchered and held back by mobile, which will eventually have desktop feature set anyway in a couple of years :p

    Good thing? leaves the gate open for third party. Don't like it? change it yourself. There's nothing super horrifically bad about Unity's shading, but it's never been frostbite quality and hasn't started now. Sadly.
     
  18. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    The issue is not that Unity's shader is bad (it's not). The issue is that two companies can't cooperate to help each-other. Both these companies need it, but looks like neither of them does anything out of pride, or to prove a point, or something. I know that's not the reason, but it looks like it.
    Like why can't we at least get a proper answer if anything in this regard is being done?
     
    Last edited: Aug 6, 2015
    Noisecrime likes this.
  19. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    This much is on the Unity roadmap for 5.2, due out in a month:

    Substance Integration updates

    • Feature parity with Substance Designer 5.1
    • Updated how Substance engine and Unity communicates (now a proper message queue); gets rid of many corner case stalls/bugs
    • Dynamic parameters in Substance graphs are now evaluated using native code instead of bytecode on Windows/Mac/Linux, resulting in faster texture generation
     
  20. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    That has nothing to do with the shader looking like substance painter results though.
     
  21. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I'm really not sure Unity will change and correct their PBR shader problems (like too much specular).
    If you need great PBR, i would say don't wait and pick up alloy, you are assured to get same PBR look between Painter and Unity after import.
     
  22. Deleted User

    Deleted User

    Guest

    Hi,

    I can help to shed some light on the issues. I'm sorry, but I think you have the wrong idea on the cause of the issues. I can understand your frustration, but please let me assure you that its not an issue of non-communication or pride between companies. We have a great partnership and communication with Unity and have had several meetings with them over the shader issues and have been working with them over the summer to help resolve the problems.

    Unity does have good shaders and they working to make them even better. They are currently working on the bug for the reflection probes which has been a pretty big issue. They are working on the issues, but I don't have an ETA on when it will be ready.

    The issue with the discrepancy in shaders stems for the fact that there isn't a real standard with PBR. There are common implementations, but different engines implement the data differently. This is actually very common. I feel Unity has chosen a specific implementation in order to best support their customers on both PC and Mobile. This was a good thing Unity did for their users. Unity allows you to compile to different platforms and they needed an implementation with PBR that allows for that. In this regard, they chose to use a blinn/phong BRDF as it works best with mobile and have a closer approximation to PC builds. This doesn't mean Unity shaders are bad, its just a different implementation (mainly the BRDF) which happens to cause a discrepancy with our shader. Unity is currently using a different BRDF than most implementations and they are aware of the issues it can cause from the talks we've had with them.

    For Substance, we chose to match the Disney implementation as close as possible. We are using GGX BRDF and for the environment , we use Importance Sampling. Now in this regard, our use of Importance Sampling is different than Unity's use of gloss cubemaps. Here is an area where we should look at an option to enable gloss cubemaps over importance sampling for engine previews.

    I hope this helps to shed some light on the topic. We just want to be as open as possible with the communities. Please know, we love Unity and they are a great partner with Substance. Neither company is in no way trying to not work with the other.

    Cheers,

    Wes
     
    KRGraphics and hopeful like this.
  23. Deleted User

    Deleted User

    Guest

    Hi,

    The issue with the too much specular is that difference in BRDF. Also, Unity has an issue where changing the reflection probe resolution is varying roughness/smoothness in function of the resolution of the environment. This means we can't come up with a way to remap our roughness textures to match what is expected by Unity's shaders since the roughness scale depends on the user's game cubemaps resolution. Unity is working to fix this bug.

    For now, I would recommend to use a lower resolution in the reflection probe and don't change it. Keep this resolution set for all probes in the scene. If you need to remap any values, you can do this based on the resolution set in the probe.

    Cheers,

    Wes
     
  24. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    Is Unity going to give game devs the opportunity to choose GGX if they want?
     
  25. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    Check the thread that n00body posted.
     
  26. Allegorithmic

    Allegorithmic

    Joined:
    Apr 1, 2015
    Posts:
    11
    I believe GGX will be added as an option. It would be best to have someone from Unity confirm, but from what we have discussed with them, yes it will be added.

    With that said, you can actually add it now. The unity standard shaders already have GGX, but its disabled by default. There is a process where you can edit the shader code to use GGX and then import the shader into Unity for it to work. I'm sorry, but I'm not sure how this works now. I don't remember which shader file it is, but there is a flag in the header for GGX = 0. Changing this to 1 will activate GGX, but there might be other areas to update as well.

    Cheers,

    Wes
     
  27. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    Are you going to add a viewport shader in Substance (Painter, Designer) that we can enable to get similar or same results as Unitys BlinnPhong BRDF? Or is this simply out of scope because of the way everything is glued together in the background of your engine?
     
  28. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    From what I understand, the deal breaker right now is the bug with Smoothness in materials being affected by the size of the cubemap, making producing a proper smoothness map for Unity impossible.

    As soon as they fix that, it would be much simpler for allegorithmic to provide an export that has similar results (at least as similar as the different BRDFs allow)
     
    hopeful likes this.
  29. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I hope Unity will bring it not too late, i know Unity is not geared towards AAA looking big games unlike Unreal 4 and Gears of War 4, but they should really consider making their PBR system better and solid.
     
  30. Allegorithmic

    Allegorithmic

    Joined:
    Apr 1, 2015
    Posts:
    11
    Yes, this is correct. The major issue is the change in smoothness based on the reflection probe resolution.

    Cheers,

    Wes
     
  31. Allegorithmic

    Allegorithmic

    Joined:
    Apr 1, 2015
    Posts:
    11
    Hi,

    I'm sorry, but we will not add a blinnPhong BRDF. GGX is the better option for PBR and most other implementations are using GGX. From my understanding, Unity will support GGX as well. They actually already do as GGX can be enable in their current shaders, but its a manual process of enabling the flag in the shader code and importing the shader into the project.

    Cheers,

    Wes
     
  32. echo4papa

    echo4papa

    Joined:
    Mar 26, 2015
    Posts:
    158
    That seems sort of silly to me. I get that it's extra work, but by eliminating different BDRF models you aren't adding features, you are removing features. I'm not trying to say BlinnPhong is better, but it's still nice to have the option depending the project.
     
    Devil_Inside likes this.
  33. Allegorithmic

    Allegorithmic

    Joined:
    Apr 1, 2015
    Posts:
    11
    Hi,

    Its not about extra work and eliminating options and features. We are focused on providing the most accurate implementation which is to say that we are adhering to the standards set by Disney. While there isn't a set in stone standard, GGX is considered to be the "correct" BRDF and is what is used in almost every PBR system.

    To my knowledge, Unity is the only one that doesn't use it by default. Unity's reasoning for opting to use BlinnPhong has to do with their support for having the standard shader to by approximate on both mobile and PC. However, from my understanding, they will switch to giving users the option for GGX on PC. Originally Unity had GGX as the BRDF, but issues arose with mobile and they switched to BlinnPhong for all deployments.

    We are in a different position than Unity and have a wide range of integrations and adding a BRDF that doesn't provide a physically accurate result will create more problems than it would solve with Unity. We introduced our PBR implementation in Substance 4 which was long before Unity 5. We can't justify changing every substance material and re-engineering our workflows (which already follows what is considered to be the most adopted standard) to match multiple BRDFs for a single workflow. Especially since Unity is already working to provide the correct solution.

    I understand your frustration in this manner. As an artist as well, I've had the same frustrations myself. We have been working with Unity and they are in the process of updating and making changes to their system to better match Substance. We didn't invent PBR. We simply adhered to the "protocols" designed by Disney which is what all other engines and DCC software are doing as well.

    Cheers,

    Wes
     
    Martin_H and hippocoder like this.
  34. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yeah, I'm totally not interested in mobile at all because by the time mobile is capable of even running well using physically based approaches, it will also run GGX fine.

    Until that point, developers will be smarter to use custom IBL shaders that don't use either, but an approximation.
     
    hopeful and AcidArrow like this.
  35. tynew

    tynew

    Joined:
    Sep 25, 2013
    Posts:
    122
    Hey guys any updates on this matter?

    I've done a comparison post here on polycount between Substance, Marmo and Unity.
     
  36. Deleted User

    Deleted User

    Guest

  37. tynew

    tynew

    Joined:
    Sep 25, 2013
    Posts:
    122
  38. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Good afternoon from Boston,

    I think I am now running into this issue with my work as well... especially with detailed objects like a gun or a character model. And when I import my models into Unity, the visual disparity is visually evident. In the shots below I am using the same hdr maps to show the model I am working with... and the shader I am using for PBR is Alloy.

    Here is my gun in Substance Painter and Unity (Before Roughness correction)
    Screenshot 2015-09-16 12.15.01.png


    Here is the same gun in Unity... (it's too shiny compared to model in Substance Painter)


    Screenshot 2015-09-16 12.16.48.png


    Now with the roughness correction:

    Screenshot 2015-09-16 12.19.30.png

    Screenshot 2015-09-16 12.21.00.png

    The roughness corrected version of my textures feels correct to me... and I think Unity should include some form of Importance Sampling for environment map to ensure correctness... it will hurt a production if artists have to tweak the end result because of disparity... even with Alloy, I have to do corrections.
     
  39. Deleted User

    Deleted User

    Guest

    HI,

    We've been working with Unity and I'm very happy to say that there are some great improvements to the Unity Standard Shaders on the way. I've been working with an internal build from the Unity devs and textures from Substance Painter to Unity are now matching much more closely. I'm not sure when Unity will release the updated shaders, but I just wanted to post an update to the community on the progress and that its looking good : )

    Here's a screen shot from a project that I created with the new build for Unite. We are giving a talk on PBR and Unity 5. This image is all Substance Painter and Designer.

    Cheers,

    Wes

     
    Mihai77, spryx, orb and 6 others like this.
  40. spryx

    spryx

    Joined:
    Jul 23, 2013
    Posts:
    557
    Exciting news, glad to see improvements are on the way!
     
  41. minhdaubu2

    minhdaubu2

    Joined:
    Jun 10, 2014
    Posts:
    76
    Is that unity 5.2? :D
     
  42. echo4papa

    echo4papa

    Joined:
    Mar 26, 2015
    Posts:
    158
    Is this related to their Siggraph presentation on improving GGX performance for mobile devices?

    If so, I am excited about that.
     
    minhdaubu2 likes this.
  43. minhdaubu2

    minhdaubu2

    Joined:
    Jun 10, 2014
    Posts:
    76
    Could you give me some information about that :D
     
  44. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    That's great Unity improving the PBR shader.
    When you say closer to Painter you mean that it is still missing something from Unity PBR shaders side ?
    I would like Unity to communicate on their work and give some date realease :rolleyes:
     
  45. spryx

    spryx

    Joined:
    Jul 23, 2013
    Posts:
    557
    Something was mentioned about switching to GGX from Blinn-Phong during the keynote.
    Maybe we will see the shaders in 5.3?
     
  46. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I have solid expectations for that.
    I would like to compare with Alloy when it will be out and see if Unity finally catches up on quality PBR :rolleyes:
     
  47. spryx

    spryx

    Joined:
    Jul 23, 2013
    Posts:
    557
    I'm sure it will. Some of the games from the demo reel looked incredible. I just want baked lighting fixed on mobile :)
     
    zenGarden likes this.
  48. echo4papa

    echo4papa

    Joined:
    Mar 26, 2015
    Posts:
    158
    minhdaubu2 likes this.
  49. Unreal-Vision

    Unreal-Vision

    Joined:
    May 6, 2013
    Posts:
    58
    Hi Wes,

    Hope to see your Unite presentation asap. :)
     
  50. Allegorithmic

    Allegorithmic

    Joined:
    Apr 1, 2015
    Posts:
    11
    Hi,

    The shader changes will be in the 5.3 release.

    Cheers,
    Wes