Search Unity

UBER - Standard Shader Ultra

Discussion in 'Assets and Asset Store' started by tomaszek, Jun 23, 2015.

  1. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    could you answer my question too - pls?
     
  2. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    Could you update the first post in this thread Tom? Have you checked if Uber is compatible with the latest Unity beta?
     
  3. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    It should be if you take version from my server. I plan to submit latest U5.4.0RC2 version on assetstore as well, because U5.4 seems to be more or less final in terms of shading pipeline on Unity side.

    Tom
     
  4. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    More than performance it's due to resources constraints. However U5.4 introduces texture arrays. As for next big RTP update UBER will at some point will also benefit from this technique - that's what I plan.

    Tom
     
  5. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    >It should be if you take version from my server. I plan to submit latest U5.4.0RC2 version on assetstore as well, because U5.4 seems to be more or less final in terms of shading pipeline on Unity side.

    Does a link exist? Could this info be posted somewhere for convenience? I usually check the first post of this thread so that I don't have to read through all posts.
     
  6. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    http://www.stobierski.pl/unity/UBERUpdate.php

    But I guess you could wait these few days for UBER1.1c for U5.4 on AssetStore. I'm introducing a few improvements & fixes comparing to what's on the server.

    Tom
     
  7. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    567
    @tomaszek Tom, it's possible to disable tessellation in a script for all materials at runtime?
     
    Last edited: Dec 2, 2017
  8. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
  9. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
  10. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    567
    @StaffanEk Nope, I have too many materials that use tessellation.

    I changed a UBER_GlobalParams.cs and UBER_StandardInput.cginc to make it possible to set tessellation amount for all materials. However, I'm not sure that this is a good solution...
     
    Last edited: Aug 4, 2016
  11. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    If you'd like to disable it completely you might use LOD keyword in shader and set maximum lod level for such shader globally this way all tesellation shaders will fallback. If you would like to adjust amount of tessellation (to reduce it for performance gains on slower hardware) yes you could do it in shader code (tessellation .cginc file) basing on some global variable set by your script.

    Tom
     
    nxrighthere likes this.
  12. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Hi,

    Wondered if it's possible to change .r for vertex blend to .a, and use rgb for tinting? This seems to give it more use cases.
     
  13. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Look at conf. part of selected shader:

    Code (csharp):
    1.  
    2.      // available r, g, b, a, comment out if you don't want to control it via vertex color
    3.      #define VERTEX_COLOR_CHANNEL_DETAIL r
    4.  
    5.      // 1st layer coverage in _TWO_LAYERS mode
    6.      #define VERTEX_COLOR_CHANNEL_LAYER r
    7.  
    then here you've got another conf. part to eanble tinting:

    Code (csharp):
    1.  
    2.      // you can use below switch as diffuse color (albedo) tint
    3.      //#define VERTEX_COLOR_RGB_TO_ALBEDO
    4.      // when above enabled DIFFUSE_ALPHA_MASKING allow to mask tinting via alpha channel of diffuse texture
    5.      //#define DIFFUSE_ALPHA_MASKING
    6.  
    simply adjust VERTEX_COLOR_CHANNEL_DETAIL to use a instead of r

    I guess in the future we could think about using another uvs (higher ones like speedtrees do) to control different things as 4 channels of vertex color might be limiting in case we need to control plenty of features at once (water/snow coverage, tint, layer/detail coverage, ao, etc)

    ATB, Tom
     
    hopeful and hippocoder like this.
  14. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    You were right about the post FX; the black screen flash is caused by having refractive surfaces while using PRISM's Bloom effect. Their bloom uses a blurred screen grab and it seems like pieces of the refraction screen grab sometimes pop in and overlay the whole bloom texture.

    But the issue where it renders stuff in front of the refractive surface instead of behind it is still happening without any post effects. For example:
    Capture.JPG

    That refraction is of the gold/green cube in the foreground. There's nothing like that behind the blue glass.
     
    Last edited: Jul 26, 2016
  15. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Refraction is implemented common way - I'm acessing screen color buffer and get its statewith uvs distorted by refractive surface normals. So - for higher refrfaction values it's pretty possible to have some pixels that belongs to objects that are in front of your stained glass as they exists in screenbuffer. To fix it we'd need to sample depth buffer as well and compare shaded pixel on refractive glass with screendepth to reject pixels that are in front of refractive object. Even describing this sounds complex. And I don't like to make this refraction stuff even more complex...

    Tom
     
  16. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    I don't seem to have this issue with Unity's old school Refractive shader but I don't really know how they do that. I guess for now I can just turn off refraction; it's a cool effect when you're standing close to the window and looking through it but the rest of the time it tends to look weird.
     
  17. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Hi @tomaszek thanks for your reply, seems easy to try. I had another question about optimisation though, things can get a bit slow on some hardware incl console so I wondered if there's tricks to try.

    I read that Unity added https://docs.unity3d.com/540/Documentation/Manual/SL-TextureArrays.html and wondered if this would offer a performance increase in Uber for vertex blend shader etc? Could pack everything in there and it would be less switching / bandwidth? Curious about your thoughts on the matter for optimising as we do love the whole weather system etc...

    Plus any tips you can give us to optimise vertex blend shader or advice is helpful, thank you :)
     
  18. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Texture arrays would introduce no real gain here as we'd need to blend between at least 2 layers anyway. For performance to push it up I'm not sure. Maybe decreasing heightmap resolution (as it's not "visible" directly and using alpha8 format) might help just a tiny bit. Weather system is more demanding here rather comparing to 2 layers shader variant (try to use lower res glitter/snow texture maybe - I included 256,512,1k variants of this texture in UBER package). The same for rain droplets texture, youmight gain a bit lowering resolution of this texture if this is visually acceptable.

    Tom
     
    hippocoder likes this.
  19. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yeah it sounds as if the main performance comes from bandwidth gains then? Thanks for your tips.
     
  20. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    It might be bandwidth limited, but not only. All calculations are a bit massive as well. Simply check this.

    Tom
     
  21. Louen_ZT

    Louen_ZT

    Joined:
    Dec 11, 2015
    Posts:
    4
    Hi there, amazing work on this asset. I only just started to use it and the amount of work put into it is quite overwhelming, I'll have to learn it step by step I guess!

    I was wondering, for a test I was trying to do, is there any "outline" shader (cell-shading kind of thing) on the available shaders? or any option that can make that happen? or would I have to add the outline modifying the shader scripts myself?

    Thank you.
     
    hopeful likes this.
  22. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    you need to tweak it yourself. Use some #define keyword i your customized shader and use #if YOUR_KEYWORD in core .cginc files

    Tom
     
  23. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    @tomaszek

    Hey buddy.
    Not sure what's going on here, or if there's some easy fix I can do to this.
    But I updated to the new Unity 5.4 and Uber won't work.
    I got 4 different types of Errors.

    Even started a new Project and still to no avail.

    I have uploaded photos.
    The last one now sure if that has anything to do with this or not.

    Error_IMPORT_2ndPackage.jpg 9Errors_SameTHing.jpg Inspector_Errors.jpg UnityError_WHEN_EXITING.jpg
     
    RonnyDance likes this.
  24. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    After updating to 5.4 I also get Pink Objects. I am using UBER Metallic or Specular Dynamic Snow Shader on my pink objects.
    Saw that tomaszek uploaded a 5.4 version of UBER to personal webspace. So I am sure new version fixing this problem will hit the assetstore soon.

    Best regards
    Ronny
     
    N1warhead likes this.
  25. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Two days ago I submited UBER1.1b tested on the newest U5.4.0. This package version is awaiting approval by AssetStore staff.

    Tom
     
  26. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    @tomaszek Thanks man, much appreciated... I mean I like the Standard Shader, but yours blows it out the water with all the extra features lol.
     
  27. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    Hi @tomaszek
    I've attached a couple of tiny patches for RTP & Uber to allow compilation to proceed when build platform is WebGL.
    (I'm still awaiting my build to tell how it looks ;-) )
    HTH, Rupert.
     

    Attached Files:

    John-G likes this.
  28. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I have a very strange issue that has popped up recently. My UBER textured character looks completely gray or in some cases nearly black. Now here's the interesting part. In a new scene where I have the character, it appears all gray in scene view and all gray when running the scene. However, the same character in another scene is mostly black in scene view, but renders perfectly fine in play mode.

    I tried right clicking and re-importing UBER, but that didn't change anything. Recently, I did recompile the shaders to include linear fog. Suspecting this was the issue, I just commented the fog out and reimported shaders and the issue goes away. So this is somehow a fog issue.

    EDIT: I am using Unity 5.3.4p6.
     
    Last edited: Jul 30, 2016
  29. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    UBER1.1b working with U5.4.0 is available on AssetStore now.
     
    N1warhead and nxrighthere like this.
  30. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Tom, are you planning on adding a SpeedTree Shader variant into the UBER Package? Standart Speedtree shader is severly lacking, and the community attempts at creating a PBR Speedtree shader could also be improved.

    I guess a Speedtree shader written with your expertise would really add another big reason to get the UBER Package.
     
  31. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    http://forum.unity3d.com/threads/speedtree-for-unity-5.415561/#post-2711454

    We're doing our best to start crowfunding for our game. As soon as we get funds to work in calm further I think I can push it to the public to help community.

    Tom
     
  32. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Oh, great, thanks for the information. Will eagerly await this, and given you would have posted a crowdfunding link, might have contributed to you reaching the funding goal *hint* ;)
     
  33. muhammad_ahmad1999

    muhammad_ahmad1999

    Joined:
    Aug 4, 2016
    Posts:
    7
    Hello!

    I need your help. I tried to solve the pink shader problem but I think it is due to an error in the shaders.

    It is linked with the globalillumination.shader at line 190.

    I tried a solution posted on the support forum but now I get this error:

    UNITY_PASS_TEXCUBE_SAMPLER is not defined.

    Please help!
     
  34. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    UBEr version and Unity version please. I submitted UBER for Unity 5.4 from beta23 as far as I remember, but you should upgrade unity to newest 5.4.0f3 and then download UBER from assetstore that match. It's still UBER 1.1b but package version differs depending on Unity - i.e. UBER1.1b that works on U5.3 will not work on U5.4.

    So it looks like AssetStore gives you package version that does not match your Unity version.

    Tom
     
  35. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
  36. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Will post it everywhere when it start :)
     
  37. muhammad_ahmad1999

    muhammad_ahmad1999

    Joined:
    Aug 4, 2016
    Posts:
    7
    Hello!

    Thank you for your quick reply! :)

    I have tried 1.1b with unity version 5.4.03f as well as unity 5.4.0b.

    I get the error on global illumination shader at line 190. So I changed it according to a solution posted by another user on this forum.

    Then I get the other error. By the way, due to this all the materials are pink -> even if you apply a new shader in a new project to a new mesh.
     
  38. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Something got stucked on Unity side then. I've just downloaded UBER from assetstore from Unity5.4.0f3 and it works. I'm pretty sure the package version doesn't match Unity 5.4. It should be marked "UBER1.1b (U5.4 release)" in verinfo.txt. Try to dig into forums. I remember you're not the first user that has such problem. There is a way to remove current unity packages that are already downloaded on your local machine. Then you should be able to download it again in Unity5.4 and version will match.

    Tom
     
  39. robymv

    robymv

    Joined:
    Oct 28, 2013
    Posts:
    74
    Hello everyone, I have installed the Unity 5.4, and now I get this message on models that use Uber materials: SkinnedMeshRenderer doesn't support instancing. Skip rendering.
    UnityEditor.DockArea:OnGUI()
    Somebody know solution?
    Thank you.
     
  40. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    SkinnedMeshRenderer isnt currently supported by unity's instancing so it renders it normally, I imagine Uber does support instancing. It should be harmless though, it's just letting you know.
     
  41. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I found Unity Standard Shader in U5.4 has instancing set in core files (and I followed this in UBER) but it's not compiled in Standard Shader. I set it to be used in UBER though, so peole who need to render 1000 exactly the same small pebbles on the shore (with different orientation, size or placement) will do it in 1 draw call instead of 1000.

    Tom
     
    Shodan0101 and hopeful like this.
  42. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    That's great to hear. Thanks for adding this @tomaszek. Saves a lot of time and effort.

    doc
     
  43. muhammad_ahmad1999

    muhammad_ahmad1999

    Joined:
    Aug 4, 2016
    Posts:
    7
    Hello, Tom.

    Just a question about Uber.

    Do you not have a roughness channel for the metallic workflow???

    Is there an option to feed it through a texture?


    Thank you in advance.
     
  44. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Roughness is there - but inverted. Called smoothness (which is 1-roughness). Simply invert your roughness map and feed into UBER metallic workflow. You could even make a hack and invert it right inside shader smothness range. Gloss min/max in uber - if you swap min with max you'll have inverted values of roughness which become smoothness values then.

    Tom
     
  45. muhammad_ahmad1999

    muhammad_ahmad1999

    Joined:
    Aug 4, 2016
    Posts:
    7
    Thank you for your quick reply!

    I understand it now.

    Another question: in unity terrain, we have to use textures. Is there a way to use UBER materials on terrains??? For example, a parallax ground material on the terrain???

    Thank you!
     
  46. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    For parallax mapping on terrain there is another tool called RTP (Relief Terrain Pack). You can get it at upgrade price when you've got UBER.

    Tom
     
  47. Holy-Manfred

    Holy-Manfred

    Joined:
    Nov 30, 2013
    Posts:
    15
    So, does that mean Uber shader should work on skinned mesh renderers ? Becaucse I am still getting no supported/skip rendering error spam in Unity 5.4 and Uber 1.1b when unsing Uber on my characters :(
     
  48. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    277
    Just playing around with uber and wanted to test transluency on chars:

    getting:
    SkinnedMeshRenderer doesn't support instancing. Skip rendering.

    is this the solution?
    http://forum.unity3d.com/threads/sk...stancing-skip-rendering-how-to-fix-it.424023/
    ----------------
    Try looking at the shader and seeing if it includes the following line.
    #pragmamulti_compile_instancing

    If it does delete it.
    ---------------

    any official fix?
     
  49. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    No if this problem breaks UBER usability on skinned mesh, you can simply comment out instancing support by removeing (commenting out) above #pragma directive. To not disable instancing on other objects you could make it on a copy of particular shader used (put it into Custom shaders that's supposed to hold such stuff).

    I doubt skinned meshes will allow for instancing soon (if ever) because they influence mesh realtime - 1st objkect mesh which is in pose A has technically mesh that is completely different on 2nd character in pose B. Instancing is intended to render more or less "identical" objects (with some small parts different like color position size, etc., not whole mesh - I mean when pose A != pose B).

    Tom
     
    Arganth likes this.
  50. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Tom, I have played around with UBER related stuff this morning and I have some questions now.

    Deferred Lighting internal shader for UBER and RTP:
    In the UBER documentation I read that to have UBER work as expected in deferred lighting, you need to replace the deferred lighting internal shader. Makes sense, is the same for other similar assets.

    BUT: I am also using RTP in the same project. This also has its own deferred lighting internal replacement shader which I had used up to now.
    Now, I am not using any more complex UBER features like translucency (which I guess would only work with the UBER replacement shader in place)... but just for kicks, I switched the RTP replacement shader for the UBER one, and I noticed that rendering of the UBER shaded objects was changing. Hard to describe, as the rendering isn't really broken using the RTP replacement shader. I noticed that especially specular reflections seemed a little bit stronger, and more nuanced. I guess this is quite different in RTP as there the shaders are not really following the Unity standard shading model (yet).

    Now, RTP terrain materials are of course also affected, and there the UBER replacement shader introduces different weird artefacts. I can try to make screengrabs if you want to know more, but I don't think this is so important.

    The question now is: do you have a version of the deferred lighting internal replacement shader that integrates the RTP and UBER one, and makes sure the RTP terrain materials AND uber shaded meshes get properly lit?
    If you don't have such a thing (and I fully understand that, given it makes more sense to do that once RTP, or a successor product, is supporting the same shading capabilities that UBER does), is it possible to hack one together now by opening up the two files and somehow integrating them?
    I didn't dare to do that, but would be ready to do it given you think it isn't impossible or too hard to do.


    POM not working on some Meshes:
    I did apply the UBER shader to a mesh I haven't touched in quite a while, and because part of that meshs texture contains the same texture used for the terrain, wanted to see if I could make the mesh use a similar POM Setup I am using for the terrain currently.
    Now, for some reason POM isn't working for me. If I activate it, the mesh doesn't seem to be shaded any differently than without it.

    I do get some errors about Unity running out of shader keywords, but the errors are just about the self shadowing keywords.

    Is it possible that I just need to reduce the amount of shader keywords used? Is there an easy way to find the biggest offender in my project save creating a new project and adding shaders until I get these errors?