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. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Hi,

    I exported some model from substance painter, testing two modes :standard metallic and standard specular. But the two standard PBR shaders within Unity don't produce exactly the same look.
    It is related to Unity shaders that are lacking PBR quality ?
     
  2. Elzean

    Elzean

    Joined:
    Nov 25, 2011
    Posts:
    584
    Can you show the differences you are seeing ?
     
  3. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    The textures exported are 4096*4096
    Unity standard PBR shader




    Substance painter
     
  4. Elzean

    Elzean

    Joined:
    Nov 25, 2011
    Posts:
    584
    Did you check your import settings and made sure of your current quality in the project settings ? (it looks low res)
    Also some map seems to be missing on your helmet, is it possible some other for the metal / roughtness / normal could be missing too ?
     
  5. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I exported from Substance painter to Unity standard metallic format, i checked textures and format, channels in Substance painter, all is ok and following Unity 5 conventions.

    The imported textures have values that don't match as good with Unity 5 PBR shader, something would need ot be adjusted within Substance Export or within Unity shader system to have them matching.
    Specular is a bit too strong or roughness is a bit too low and color is somewhat brighter when used in Unity 5.

    I changed Unity 5 quality texture to full format, but still the quality difference is big.


    If someone uses Substance Painter, their feedback could be usefull :)
     
    Last edited: Mar 25, 2015
  6. Deleted User

    Deleted User

    Guest

  7. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    did you check the Quality settings for max texture quality?
     
  8. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Best way to compare is to use the same skyboxes.
    But the main issue I believe is the smoothness map. You need to remap the smoothness values for Unity, as Unity uses a mapping similar to Marmoset Toolbag, while both Substance Painter and Designer are uncalibrated.
     
  9. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,649
    Don't forget that as well as the Quality Settings being set to max texture res, you should also check the import size your textures are set to - I think it's 1024 by default so if your textures are larger than that you should increase it.
     
    shkar-noori likes this.
  10. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    minhdaubu2 likes this.
  11. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I put Max res for textures. the problem is diffuse looks more bright as some black colors in substance looks grey on Unity.

    The problem that bothers me is more from the metalness that is too high and not corresponding to subtance visual look.

    Thanks i will try.
    Using Substance and seeing Unity 5 metallic and specular shaders i thaught you just needed to export textures to one of these formats and it's done, without any tweak needed (like simple normal map and specular workflows).
     
  12. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Well if substance painter isn't doing the right export then it shouldn't provide an export option called Unity until it does. Because it isn't exporting correctly to Unity. Both parties should remedy this. A friend also had this problem recently, and couldn't find a solution (this thread is too invisible) and now is using UE4, which worked out of the box. It's the little things all over the place that make people shy from Unity when they don't have to.
     
    Ony likes this.
  13. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Yeah, I don't know why Unity can't collaborate with Allegorithmic, to come up with either a shader that will work inside Substance Designer/Painter, or proper export options for both spec/gloss and metal/roughness workflows.
    That's in the interest of both parties. It shouldn't be the artists job to guess the right values.
     
  14. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Now in Substance Painter you can even create any custom export format using any texture or any RGBA channels. What is the UT5 export value if it don't works as good as UE4 (without needing any tweaks)?
    It seems UE4 PBR has a bettre quality to handle metallic and roughness, while Unity is too strong on metallic or roughness not pushed enought, it's like UT5 shader don't have a good range PBR values.
    Anyway if Unity and Substance could work together and determine where is the work to be done : UT5 PBR to adjust shader and vlaues or Allegorithmic to change the export to adapt to Unity specific PBR values ?

    I'm suprised that not so much people complained more about unity PBR quality.

    Yes, i think we hope metallic and roughness to stay the same between some painting app and the 3D engine.
    This is not the first time that i see some people working with UT5 and saying their work PBR, but it looks wrong and not as precise as UE4 PBR. So it is to Unity to change something and make adjustments perhaps to have the righ rendering out of the box ?

    For now i stay with UE4 for PBR work and game idea , even if Unity can have faster speed i prefer to loose some speed and have a good PBR rendering instead of some approximative not looking as good.
     
  15. PixelMind

    PixelMind

    Joined:
    Aug 16, 2013
    Posts:
    101
    Substance uses "roughness" for its surface definition.
    Meaning that in Substance Painter 0 = not rough (smooth), 1 = rough.
    Unity uses "smoothness" where 0 = not smooth (rough), 1 = smooth.

    If you're using maps straight out of painter with default settings, then you'll have to flip the roughness channel which in Unity means your Metallic texture's alpha channel. I'm not sure if this can be automated in painter somehow. I just flip it manually when I move it to my metallic's alpha.

    Another important settings is your color space. You should pretty much always use linear color space if you're using physically based shaders. The math screws up if you don't... and you lose the whole point of using them in the first place.

    The setting can be found here:
    File > Build Settings > Player Settings > Color Space == "Linear"

    On the image below the right most version is correctly using flipped roughness. I didn't try to match the lighting perfectly but they are definitely very similar.

     
  16. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Thanks for the info ; i 'll post the tests tomorrow night.
    Your example is not very representative as it don't show different levels of roughness and levels of metalness :D, it's very metallic everywhere.

    But again , can't Unity correct their shader that is not standard PBR as used by painting programs ?
    They should really look at what Unreal 4 has done in that side, with Unreal 4 you drop your PBR textures and that's it :rolleyes: : it's as simple as working with normal/specular old way, no tweak needed.
    A big advantage and you don't have to make more work because Unity don't follow the right way.
     
  17. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I have no idea why Unity went hipster with this against the entire industry, but there you go. Roughness is as close to a standard as one would care to get, but it's a trivial fix. It just needs louder explanation and documentation.

    I'm not sure there's a globally accepted right way. Everyone has pros and cons to their implementations.
     
  18. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    I hope you are aware that there is no actual standard regarding PBR.
     
    Aurore likes this.
  19. UnityGuillaume

    UnityGuillaume

    Unity Technologies

    Joined:
    Mar 16, 2015
    Posts:
    123
    The problem being that exactly there is no standard...

    If I'm not mistaken, Marmoset uses a Smoothness setting (0 = rough 1 = smooth). I think quixel use that too. Yet other tools & engine use Roughness setting (0 = smooth, 1 = rough)

    Some artist think that it's more natural to paint black part that will be rough, other the other way around. Sadly nobody settled for a thing yet.

    Substance Painter seems to have something call Glossiness that would generate the map properly : https://forum.allegorithmic.com/index.php?topic=3885.0 (their Unity5 preset should have taken care of that though, curious to see what's the preset is made of, no Substance Painter on that computer)
     
  20. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Substance , 3D coat uses roughness and metalness maps.
    Marmoset is not a standard, they braught one implementation Unity just followed when they went into PBR.
    But all other software just don't use that implemenation and use Rought/metal instead ,and these are more easy to understand and better to work with.

    Anyway will Unity make changes in it's shaders or propose a new one using the most used standards ? :rolleyes:

    About DDO i don't know if they have some Unity 5 preset that works well ?
    What people uses to make PBR assets ? 3D coat or Substance ? Both are not compatible right away with Unity 5, while ready for Unreal 4 :)
     
    Last edited: Mar 26, 2015
  21. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    If Allegorithmic has an export option for Unity, I guess it is clear who is responsible.
     
  22. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I consider it a mutually beneficial responsibility. Allegorithmic is ultimately responsible for implementation, but Unity (if it knows whats good for itself) needs to bear the responsibility of reaching out, communicating and fostering an effortless result for their mutual customers.

    Otherwise Allegorithmic's relationship with Epic might well get stronger and stronger, and this isn't fun for Unity and Unity's prospective customers.

    Ooh, I heard UE4 just works magically with painter. But Unity doesn't.
    When this is extrapolated over a number of tools and resources it becomes an actual problem. That's my analysis that everyone is free to ignore.

    In before someone at Unity says "but that assumes we're not already reaching out and fostering relationships" well then if that's the case, where's the working result?

    Just fix it. I need the tools my business depends on to be of a brilliant standard across the board :)
     
    Ony, Deleted User and reese01 like this.
  23. Deleted User

    Deleted User

    Guest

    Hi,

    The issue as mentioned earlier in this post comes down to the remapping that the unity shaders are doing with the "smoothness" map. I feel the Unity implementation of PBR is very confusing and that is unfortunate for users.

    They are using a "smoothness" map for both metal/rough and spec/gloss workflows. Their smoothness map is actually a glossiness map. So for their metallic workflow, they are using a glossiness map instead of a more conventional roughness map. The have also set the default shader to be metallic workflow (Standard Shader) which makes even less sense in that instead of roughness it uses smoothness (invert of roughness). I think their approach was to try to use the same "smoothness" map for both workflows in an attempt to simplify or make easier for users switching to PBR. However this has created a great deal of confusion as it already creates another deviation (metal/smoothness) in a system (PBR) where there is not a set in stone standard to begin with. However, metal/rough or spec/gloss is usually the widely adopted workflows. The Unity metal shader was adopted late in the beta in response to a large vote from users asking them to adopt the metallic workflow.

    With this in mind, Substance Painter will soon add the spec/gloss workflow. Substance Designer already supports both workflows. When you export the metal workflow using the Unity 5 preset, it will auto convert the roughness to glossiness (smoothness map) for Unity. It will also place the smoothness map in the alpha of the metallic, so the channels will be packed correctly.

    However, regardless of the worflow metal/rough (converted to smoothness) or specular/glossiness, the smoothness map will still look too shinny as the Unity shader is shifting the gamma as well.

    In the video linked by @Devil_Inside , I show how I created substances for the Unity Space Station scene. I add a levels and expose the midvalue to adjust the gamma in Unity. http://www.twitch.tv/allegorithmic/c/6366904 I will upload a youTube version as well.

    You can do the same thing in Painter as well. The process is as follows:
    1. Create a standard layer at top of layer stack
    2. Add a levels effect to the layer
    3. Change the channel mode at top of layer stack to roughness, then on the layer set the blending mode to pass thru.
    4. Select the levels effect and set the affected channel to roughness in the properties.
    5. Adjust the gamma to lower it ( move towards the left).

    What this does is change gamma before export so you can offset the shift that happens in the shader.
     
  24. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    This is what i see, because the metalness is always too much exagerated in Unity.
    Even with values between 0-1, it seems their metalness is already going hight at 0.5 value.

    I think their PBR model is not good compared to what we see in Substance or 3D coat ( i don't know for DDO).

    Thank you for the info.
    But i think all 3D artists would want a simple drag and drop workflow like when we use Unreal 4.
    Textures exported from Substance or 3D Coat to Unreal 4 a ready to use, no over work or tweakings needed, they looks great out of the box.
     
  25. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    @wesm , in the twitch video you said that you found 0.4 being the closest remap value to get the smoothness in Unity look like Substance. Why can't you guys ask Unity how EXACTLY they remap the roughness, so you could get the exact workflow and recreate it in substance tools?
    Also, why don't you do it automatically when you export the maps? I think a loooot of people haven't seen that video to know that you need to adjust it manually. Even though I've seen that video earlier, I spent like 30 minutes looking for it yesterday (I forgot that you have a twitch channels and was looking only on youtube). Imagine that half the users missed that video altogether. You do have separate export profiles, why not use it for remapping as well?
     
    minhdaubu2 likes this.
  26. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    IMHO there is still time for patch 5.1 to address this, and change everything yet again. And they should, by shunting the existing ones to legacy.

    Far better than constantly trying to battle some mystery value X.
     
  27. Deleted User

    Deleted User

    Guest

    Yeah, during the beta they changed the values a lot. It was a moving for target for us.

    @Devil_Inside We definitely want to do this. You can see how they are remapping the smoothness in their shader code. Its just changed so many times and we need to contact them to make sure its not going to change.

    We want to have a one click solution where the roughness is converted and remapped on export so it matches Unity. In my opinion, it still seems like Unity is trying to figure out what they want to do. We will definitely keep on top of this to make is seamless for Substance.

    Cheers,

    Wes
     
  28. CodeMonke234

    CodeMonke234

    Joined:
    Oct 13, 2010
    Posts:
    181
    Question : Does the gamma remap still apply if using Linear lighting?
     
  29. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I prefer Substance to keep it's PBR workflow and standards that can be used in Unreal 4 or Crysis without any tweaking and have Unity propose some more standard PBR shader instead of using Marmoset old system.

    Same texture with same PBR standards could be used for Unreal, Unity, Crysis or other engines. It's better for 3D artists producing content and more portable than having Unity using it's very own custom PBR tweaks and tricks forcing people to do more work to get things right.

    I think PBR got out for Unity 5 without looking elsewhere or without testing quality with different painting PBR prgrams , UT5 was a big package but now Unity should have the time to change that ?
    Will we have to pay on the Asset Store to have a good PBR shader able to use general standards because Unity don't try to bring standard usage and better looking shader ?
     
    Last edited: Mar 26, 2015
    minhdaubu2, zyzyx and hippocoder like this.
  30. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I just made a test , and diffuse color is better now it matches original one, but roughness and metalness are not good and far from accurate. Too much metallic values, not good roughness, it looks bad and should be accurate as PBR is accurate values.
     
  31. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    There is no PBR standard everyone agreed on. Everyone has their own way to do it, just like it is the case for non-realtime renderers. It is up to you whether you want to accept it or not. Substance Painter has the option to export to Unity, so it is clearly their job to make sure the results are matching.
     
  32. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    But Unreal 4 accepts full metalness and roughness with 0-1 values, even making maps manually using 0.5 you will see that metal and roughness are respected , while not in Unity. The shader is wrong about PBR.

    I tried specular export but the result is even worse as metal is a bit stronger
     
  33. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Have you tried adjusting the levels on the roughness map as it was suggested?
     
  34. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,624
    Actually I think the roughness map needs to be inverted?
     
  35. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I'm not substance expert , i just use the fill layers and standard layers when i paint. Some video or pictures tutorial would help.
    Anyway i won't make this work around on each texture on a project each time, a work around is good when you have few textures and it's not good if you have lot of textures as you'll loose your time insteda of having a direct workflow.

    I ask a more general working solution as you finish your painting , you export and that's it.

    I would like to have some DDO users feeback also ? Any DDO users please ?
     
  36. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,624
    What do you want to ask about DDO?
     
  37. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Can you answer the question?
    Did you edit the roughness map to be opposite? ie black becomes white and white becomes black? Save this and import.
     
  38. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Don't forget the height and occlusion maps too. And a reflection probe.
     
  39. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    It seems Substance will have to make some corrections with UE4 packed format.
    The packed format looks like Unity, not good.

    While substance export to PBR maps : metalness, roughtness when used in UE4, it looks like Substance viewport (appart from lightening taht is not the same).

    Yes Unreal 4 display good PBR with simple Roughness and metalness maps (no work around needed).
     
    Last edited: Mar 26, 2015
  40. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Where are Unity tutorials about that please ?

    I can't as with Unity export Rough and metal are in the same bitmap (Or give me some Gimp2 tutorial)
    Also i won't do that work around for each of tousand texures on a big project, don't you think ?

    It's like asking someone exporting to Obj format to say :
    "Just edit these orientations and that scaling each time for each of your models and tehy will ook good"
     
  41. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    I don't know why you praise UE4, imho both UE screenshots look like S***.

    @hippocoder as Wes said, he doesn't need to invert the map, it's done automatically. What he needs to do, is to apply a Levels effect and adjust the midtones on the roughness map.

    @zenGarden You can post a hundred more screenshots, but until Unity changes it's shader, or until you apply a levels effect as suggested multiple times already, you won't achieve the right result in Unity.
     
  42. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,624
    I'm not sure how it's done in gimp, but somehow open the alpha channel of the metalness map and invert it.
     
  43. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,624
  44. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I don't prise anything, i just got better results using UE4 and it's standard shader suing regular metallness and rought maps while it looks more bad in Unity.

    This has nothing to do as the Context is already here , i even added a reflection probe.
    The problem is within the shaders having the metal too strong not with environement.
     
  45. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I'm not asking just showing things are not right in Unity using regular metal and rought maps, Unreal 4 gives me better results out of the bow without tweaking i don't need anything more.
     
    Last edited: Mar 26, 2015
  46. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,624
    That's mainly because unity wants a smoothness map, while you're supplying it with a roughness map.
     
  47. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I made a 3D coat import and export , it seems it gives as good results as Substance within UE4.


    I understand.
    For a small desktop project, we can use work arounds; while on bigger projects sacle you have no choice : you will have to customize the shader if you know how to do it or you will have to buy something in the Asset Store if it is available to keep a direct workflow.

    Unity is great , but for PBR rendering and workflow for a game idea , i'll perhaps come back considering UT5 when things will get better out of the box about PBR shaders and options :rolleyes:
     
    Last edited: Mar 26, 2015
  48. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Maybe I'm blinding, but in UE substance texture looks extremely washed out. Imho the Unity one, even without the proper adjustment, looks better than UE.
    Can you spend 2 minutes and do what Wes told you to adjust the levels of the roughness for Unity and test it out as it's supposed to work?
     
  49. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I'm doing quality testing, i'm the only one making tests ans posting screenshots, even DDO users don't post anything or other PBR users are happy with actual shaders.

    All that quality and shaders check should be done by Unity employees or Allegorithlic, it's their job don't you think :rolleyes:
    I'm just showing how it looks wrong dropping the exported textures.

    And guys, please stop asking me to use some work around i don't know how to invert individual channels in Gimp.
    (i'll search and make some tries perhaps another day, but today PBR in Unity is at it is , i'm borred and have other work to do then fixing textures problems).
     
  50. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,624
    Or you could do a macro in photoshop (and I imagine gimp has something similar). Considering you would usually take hours to author proper textures I don't see why inverting a channel at some point is that much big of a deal.