Search Unity

UBER - Standard Shader Ultra

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

  1. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    Thanks. this 128 limitation of keywords is a nightmare for big games
     
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Not just big games, any game. It's hard to keep track of in Unity.
     
    Tethys, Tinjaw and ksam2 like this.
  3. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
  4. Onat-H

    Onat-H

    Joined:
    Mar 11, 2015
    Posts:
    195
    Hi Tom,
    I have the Unity 5.4 beta 14 and it also happens on fresh uber install.
     
  5. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    This is what I've just did:

    1. Installed U5.4beta14
    2. Made new project
    3. Installed UBER1.1b for U5.4 (from my server)
    4. player settings - Linear lighting
    5. quality settings - MSAA disabled
    6. graphics settings - set deferred shader to UBER one

    Example scene works fine.

    From what I can see is probably your scene has something broken vs. UBER. If you actually installed UBER 1.1b for U5.4 from my server - line 1116 of my shader GUI editor script querries for component on hidden object that stores UBER preset settings. You would need to remove this hidden object named UBER_PresetReference.

    Call anywhere in your script such code:

    Code (csharp):
    1.  
    2.       GameObject go=GameObject.Find("UBER_PresetReference");
    3.        if (go) {
    4.          go.hideFlags=HideFlags.None;
    5.        }
    6.  
    This will look for the object in scene and show it in hierarchy. You can check if it has UBER_MaterialPresetCollectionReference script attached. If not - something went wrong, but I can't tell why. The reason the object is hidden is that it's used internally by UBER. When the game object is created, the script is attached. Your error (from you screenshot) suggests that the script is not there which should nnever happen under regular UBER operation. Anyway - to fix this you may simply remove this game object and it will get recreated. UBER material inspector GUI script should't throw exceptions anymore.

    Tom
     
  6. Onat-H

    Onat-H

    Joined:
    Mar 11, 2015
    Posts:
    195
    it worked just as you described, thanks a lot. I think it might have been some problem because of version control with unity asset server. Thank you
     
  7. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    Seems Unity guys just don't listen to us about this keywords limitation.
     
    Last edited: Apr 14, 2016
  8. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    What I recently did was splitting SpeedTree shader into several pieces (separate for leaves, branch, fronds). I was able to save 7 keywords (I use hue variation, I use bumpmaps). Not to mention I simply couldn't stand and added some here and there :).

    Tom
     
    hopeful likes this.
  9. abuha

    abuha

    Joined:
    Oct 2, 2015
    Posts:
    7
    for some reason all uber standard ultra shaders in all my scenes have gone Pink. no errors no warnings.
     
  10. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Try to reimport them (right click on shaders folder). If you see no error at shader inspector I can't expertise the reason. If you upgraded Unity to U5.4beta UBER will break. You need to install 1.1b from my server (link provided above in this thread)

    Tom
     
  11. maxxa05

    maxxa05

    Joined:
    Nov 17, 2012
    Posts:
    186
    One of the player of our game (Kona) reported that using the latest mesa radeonsi driver from the padoka PPA on Ubuntu 15.10 (using XFCE), some meshes were not renderered in our game. After checking which meshes were not rendered, we came to the conclusion that it was every meshes using a Uber shader with dynamic snow. Do you have any idea why that is? Would it be possible to fix it?

    Thanks!
     
  12. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Sorry without access to the test platform (the same hardware/OS/Unity/UBER) I can't tell why it happens particularily on this configuration...

    Tom
     
  13. maxxa05

    maxxa05

    Joined:
    Nov 17, 2012
    Posts:
    186
    Well, it would be hard to do, I don't have access myself. However, I received the Player.log, and there are tons of identical errors, saying:

    LLVM triggered Diagnostic Handler: Illegal instruction detected: Operand has incorrect register class.
    LLVM failed to compile shader
    radeonsi: can't create a shader

    So it seems that something in your code can't be compiled by LLVM. Anyway, if you find how to fix this, it could be great. I guess it could happen with any driver using LLVM as well.
     
  14. RUBILYN

    RUBILYN

    Joined:
    Jun 22, 2013
    Posts:
    54

    HELLO !

    Dear Thomas !

    We Talked this like one Year Ago ... and you said like "Its not so hard" , And "Maibe soon" ...

    BUT ANY POSSIBILITY TO HAVE COLOR ZBRUSH/MUDBOX VECTOR DISPLACEMNT !

    Both in Ubber and Relief Terrain Packs !

    Anytime Soon ?

    Sir @tomaszek ...

    Myself... i and sure many, Would Gladly reaaly Pay For this products "Again" just to have that Feature As Extension in your State of art Shaders !

    I am Doing some High Quality Comercial Packages Addons for @eagle555 Terrain Composer 2 ...

    And we really urgently need this .


    Thanks so much for your Support !


    3DLABS


    PS: Some Example Of what im trying to Achieve Out of Real Scan to Vector DIsplace data ( The bellow is Unreal Engine )



    In Action in Game Engine ..



    Some people Experimenting it in Unity ..



    The overall "Default" Mudbox / Zbrush Output Vector Displace Colors method ...



    Some Further Readings

    Vector Displacemnt Codes Nodes Samples in Unreal :
    https://forums.unrealengine.com/showthread.php?5886-Vector-displacement-map
    https://forums.unrealengine.com/sho...splacement-maps&highlight=vector+displacement

    Vector Displacemnt Shader code on tropical Engine at Github
    https://goo.gl/MQiSvw

    Ptex & Vector Displacement Realtime on GPU Gems 6 Book

    https://goo.gl/AED4O0

    Sample Product in Unity Assets Store That Already Does this :
    https://www.assetstore.unity3d.com/en/#!/content/15996


    THANKS FOR LISTENING !
     
    Last edited: Apr 22, 2016
    Tethys likes this.
  15. The_Hylden

    The_Hylden

    Joined:
    Apr 11, 2016
    Posts:
    3
    Hi and thanks for the help. I noticed it wasn't exactly a shadow, but dark spots of the underlying other side of the mesh. It was almost as if the mesh was too thin and penetrating the top (like I've seen happen in Marmoset), but I knew that wasn't the case... The issue turned out to be just turning the Occlusion slider to 0. The albedo texture has an alpha for another mesh that uses it, a cape, so the alpha was being read and interfering as occlusion.

    That got me to thinking. I didn't have any displacement, or tessellation added to the hair. I saw it wasn't using an occlusion slider at all with the cutout, but when I set the shader to opaque from cutout, the slider comes back. I set that to 0 also, then switched back to cutout (on a wild, wild hunch) and the transparency is perfect now.

    Go figure :/ So all is working perfectly. I can now go in and try out things like tessellation on some meshes :)
     
  16. ittinop

    ittinop

    Joined:
    Nov 9, 2015
    Posts:
    15
    Hi Tom,

    I really like your dynamic snow and want to use it on terrain trees as well.
    Is there anyway to use your dynamic snow with nature shader?

    Even if I do not use nature shader on trees like coral, and replace it with uber shader.
    I still get an issue where terrain trees will not scale when manipulated with script.

    Thanks!
     
  17. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    UBER shaders are not suitable for Unity trees nature / speedtrees. They are special kind of shaders that interpret their vertex data different way. They are also driven by propertyblock (Unity manages scaling internally). The only solution would be rewrite nature shaders so they use UBER features like snow. Currently it's not available - UBER is "standard shader ultra" which means it can do what standard shader does and more. Standard shader can't shader terrain trees nor billboard grass. It might be the case that at some point I will release separate product to render speedtrees with augmented features (UBER snow /translucency on leaves for example). If I do I will make it cheaper for UBER customers. At this moment I'm pretty focused on another project.

    The problem stays in interpretation of displacement data. As far as I cee different products handles different displacement vector textures. Things like - global/tangent space, offset, amount of displacement (encoded in A texture channel for provided github code). Additional problem is they are often 16/32 bits per channel (either integer or floating point). Such textures are imported by Unity unless they are exr lightmaps. We can agree you can provide vector displacement textures, but how do we agree they are standard ? Experimented for a moment with a texture taken from net (ear for maya). It simply resist to work, but I probably lost some data during conversion of 32floatingpoint tif to png.

    If you give me texture example that you can assure we can treat as "standard" we can Give it a try. Otherwise most of users would start bombarding me with requests the displacement functionality doesn't work... And I wouldn't like this...

    The functionality you ask for is not widely used though. How many peope would use it ?

    Another problem I foresee is normalmaps - as we can displace things so triangles will start pointing "down" (-Z) in tangent sapce how do we encode normals ? Classic normalmaps (tangent space) will not work. They encode 2 components (xy) and decodes third (z). Encoding removes z component sign data. You would need to give not only vector displacement texture but also normalmaps encoded rgb (not DXTnm).

    So - to answer you - I sould implement this functionality as far as you can give me textures that works and tell me how do I decode them (for example with github code which takes vector displacement textures that are offseted 1/2 (0.5 means no displacement for an axis). A is amount. They are in tangent space. + normalmaps.
    I don't have test textures to work on.

    For Unity to have OKish precision it might be necessary to agree higher resolution format - like using EXR for this.

    All these issues makes the problem tough when we try to solve it solid way and not working for some special cases (like RGB 8 bit per channel) textures provided by an user.

    Tom
     
    Lex4art, ksam2 and RUBILYN like this.
  18. ittinop

    ittinop

    Joined:
    Nov 9, 2015
    Posts:
    15
    Thank you very for your reply,
    Tom,

    Hope you get around to making an uber nature shader sometimes then.
    I will be one customer for sure.
     
  19. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    (for you to know - I already started such work, but can't tell when I can finish it as I'm on the another project).

    Tom
     
    ittinop likes this.
  20. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    I have yellow warning on Unity 5.3.4p4

    Assets/UBER/Scripts/UBER_GlobalParams.cs(323,24): warning CS0618: `UnityEngine.ParticleSystem.emissionRate' is obsolete: `emissionRate property is deprecated. Use emission.rate instead.'

    Assets/UBER/Scripts/UBER_GlobalParams.cs(326,40): warning CS0618: `UnityEngine.ParticleSystem.emissionRate' is obsolete: `emissionRate property is deprecated. Use emission.rate instead.'

     
    Last edited: Apr 26, 2016
  21. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Ignore it. Still we can't use "not deprecated" version because Unity does not allow to write emissionRate property (it has getter only, there's no setter...).


    Tom
     
    ksam2 likes this.
  22. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    #pragma warning disable 0618
    would prevent it, might be able to conditionally compile for older unity if needed too.
     
  23. AntonBertelsen

    AntonBertelsen

    Joined:
    Oct 13, 2014
    Posts:
    37
    @tomaszek In my experience this works just fine for setting the emission rate:

    Code (CSharp):
    1. float rate = 1;
    2. ParticleSystem system = gameObject.GetComponent<ParticleSystem>();
    3.  
    4. ParticleSystem.EmissionModule emissionModule = system.emission;
    5. emissionModule.rate = new ParticleSystem.MinMaxCurve(rate);
    Also - You stated earlier that you were working on "another project", and that you therefore didn't have time to work on a new "Uber Nature Shader" package. - Could you perhaps give a hint towards whether this project is an Asset Store package, or something unrelated. :)
     
  24. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Have you tried to do this:

    Code (csharp):
    1. system.emission = emissionModule;
    Because maybe I'm wrong but I think changing enussionModule.rate doesn't change it on system. EmissionModule seemed to be copy of system.emission when we get it, not a reference.

    We're working on a game and needed better ST shaders, I guess I could release it on assetstore later (maybe w/o some parts) as soon as we've got enough funding on the game.

    Tom
     
  25. AntonBertelsen

    AntonBertelsen

    Joined:
    Oct 13, 2014
    Posts:
    37
    Cool. - Thanks for sharing the information. - You're a freaking shader wizard.

    I might be wrong about setting the emission rate, but I think I recall having used the method I mentioned at some point. I'm not able to test it at the moment.

    Also might I request a feature for UBER? - Would it be possible to add LOD dithering like the dither effect seen on Speedtree billboards? It would be very nice to have a way to hide LOD popping while still taking advantage of all the other shader features in your package.

    None the less, thank you for such an amazing package. :)
     
  26. aScarselli

    aScarselli

    Joined:
    Feb 25, 2016
    Posts:
    3
    Latest Version of UBER 1.1b, seem incompatible with 5.2.1p2...have set up the shaders and disabled all antialiasing..yet everything is pink

    From what Im reading 1.04 is the only version compatible with Unity 5.2
     
    Last edited: Apr 27, 2016
  27. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    That's right - 1.1b is newer version with new features that needs higher Unity. It's hard to keep track on earlier Unity versions. From version to verion (even from one minor Unity release to another) Unity makes sometimes drastic changes in their StandardShader files which cost me much work to hookup again with UBER.

    Tom
     
    Deleted User likes this.
  28. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Sell it on the asset store! :) You have a bunch of insta buyers on this thread. We use Uber, Alloy and RTP, then Scion and TOD and we cannot get away from the keyword error. The project still runs great, but some features are obviously getting broke because of it.
     
    montyfi and ksam2 like this.
  29. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    I had a question about the POM shading or maybe UBER in general: in Deferred mode does it become more expensive as the number of lights in the scene increase? I have some scenes with a ton of point lights and I'm trying to narrow down what is causing the biggest drops in frame rate when there are many lights.
     
  30. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    No matter how many lights you've got UBER POM feature will work the same fast. It's calculated to gbuffer once. Then these "ton of" point lights need to be calculated in screen space. If culling is done fine and lights don't overlap performance should be fine, but of course - deferred is not any "something for nothing" solution. It overrules forward approach in existence of many lights in scene, but the lighting need to be calculated at some point anyway. Maybe you could consider lightmapping (for example emissive spheres that influences realtime GI only). This might work faster if you don't need lighting to be of high resolution.

    Tom
     
  31. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Ah ok, good to know. :) This particular scene lets players throw torches all over the place, so I don't think I can use lightmapping. I'll figure something out.
     
  32. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Another question - How does the Refraction shader work? I get a lot of weird issues with it. Using Unity 5.3. For example, I'm placing down a Refractive object while in play mode and it will show a reflection of what is in front of it in addition to what is behind it, as if it is overlaying a refraction from both sides of the plane. It only does this for a while; after looking at it from other sides and waiting for a bit, it stops and then correctly only shows what is behind it. Is it doing some kind of trick where it is grabbing a view from the object and caching it? Because it kind of looks like that. Changing the geometry around the object tends to make the diffraction look all wrong for a while until it "settles down" and somehow fixes itself.

    EDITED: Ok, I see now it's not a reflection, it seems like it's doing a grab pass of what's currently being rendered and then displacing that in the mesh, but it's grabbing the render of everything in between the camera and the refractive mesh instead of just the things behind the refractive mesh. So in a FPS view, the weapon (between the camera and the mesh) will show up in the mesh, as if it were a reflection. Is there a way to fix that?
     
    Last edited: May 7, 2016
  33. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    I just tried UBER in 5.4 b17 and all shaders are pink. Anybody having the same issues and anyway to fix the issue?

    -Miguel
     
  34. GMM

    GMM

    Joined:
    Sep 24, 2012
    Posts:
    301
    Same issue as Miguel, would like to know if anyone has found a fix?
     
  35. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    277
    download the uber beta from his website
     
  36. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Depends on drawing order. The problem is that your weapon is drawn before refractive object. It's always case if your in deferred. Refractive objects are rendered in forward (they are kind of transparent ones) at the end. You can try to change the order of objects inside lighting path (so sort manually things that are rendered in deferred, then separately order objects that are rendered in forward - transp. objects) using custom queue that can be set per material via script (it's stored there permanently until you reset it - remember this when at some point you would think order is wrong).

    Tom
     
  37. HP

    HP

    Joined:
    Nov 20, 2012
    Posts:
    80
    @tomaszek Mr_Edward is right. You can read it in a blog article here: http://blogs.unity3d.com/2016/04/20/particle-system-modules-faq/
    Look at the "Random between two constants" example. You don't need to set emission back to update it. How it works is mentioned at "It's just an interface" in the same article.
     
  38. GMM

    GMM

    Joined:
    Sep 24, 2012
    Posts:
    301
    Thank you, found the link and got the beta.
     
  39. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    Can someone please give me the link to the website. Looking all over the place and the only site I find is the one with music nothing about UBER. Thanks.
     
  40. GMM

    GMM

    Joined:
    Sep 24, 2012
    Posts:
    301
    Took me some time to track it down aswell, here you go:
    http://www.stobierski.pl/unity/UBERUpdate.php
     
    Crossway likes this.
  41. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Thanks for the hint. I'll then remove this annoying "obsolete" warning from the next update.

    Tom
     
  42. S_Darkwell

    S_Darkwell

    Joined:
    Oct 20, 2013
    Posts:
    320
    @tomaszek:

    Firstly, thank you so much for your fantastic asset!

    My question:

    I'm looking to utilize Alloy's volume lighting with your UBER shader, for which you've included compatibility.

    I've successfully made them work together with both complete packages in the project, but as I'm only looking to utilize Alloy for its lighting, I'd light to pare it down as far as possible.

    Do you happen to know what Alloy files are actually required?

    Thank you in advance!
    - S.
     
  43. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    UBER works with Alloy lighting in deferred. You can use Alloy deferred lighting shader and UBER shaders (opaque/cut out ones) to get its features (like water/snow).

    Tom
     
  44. BYD

    BYD

    Joined:
    Jan 26, 2015
    Posts:
    24
    Hello, really love the quality of this asset
    but will there be proper substance support anytime soon?
    The shader itself works really well with them, but it seems only substance materials are not controlled by the GlobalParams script.

    Thanks in advance
     
  45. ozonex

    ozonex

    Joined:
    Dec 7, 2012
    Posts:
    22
    How can we make real Dissolve effect using Uber shader? In examples there is "Carpaint & dissolve" but it is just simple Alpha cutoff using Albedo alpha chanell.
    What we need is custom Dissolve mask and cusom slider independently of alpha cutoff to have also transparent objects that can use this effect.
    This can be easly done in Standard surface shader. Uber shader is very complex and I can't find where to add it :/
     
  46. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Can you tell me which parameter exactly is not controlled by GlobalParams ? I'd like to to check it.

    Yes, you would need separate textures for alpha cutoff and dissolve then. And this means customization of UBER. You need to find where alpha texture is sampled / used in cginc files. I know it's more complex for the obvious reason, but it's doable.

    This is the part of code you're intereseted in:

    Code (csharp):
    1.  
    2.   #else
    3.      // alpha computed regular way (in opposite to geom blend)
    4.      half alpha = Alpha(i_tex, _ddx, _ddy, _ddxDet, _ddyDet, vertex_color); // UBER - ddx, ddy, vertex_color (2 layers)
    5.      #if defined(_SNOW)
    6.        alpha=lerp(alpha, 1, _snow_val);
    7.      #endif  
    8.      #if defined(_WETNESS)
    9.        alpha=lerp(alpha, 1, Wetness*_WetnessColor.a);
    10.      #endif  
    11.    #endif
    12.    
    13.    
    14.    #if defined(_ALPHATEST_ON)
    15.      clip (alpha - _Cutoff);
    16.    #endif
    17.  
    Placed in UBER_StandardCore.cginc

    You need to sample additional texture and influence alpha variable or introduce your dissolve masking directly in clip() adding your texture controller (with slider value)

    Tom
     
  47. ozonex

    ozonex

    Joined:
    Dec 7, 2012
    Posts:
    22
    Thanks!

    I have done that effect and it works great :)

    uber_dissolve_effect.png
     
    tomaszek likes this.
  48. BYD

    BYD

    Joined:
    Jan 26, 2015
    Posts:
    24

    It seems like none of the dynamic parameters works, I made some screenshots:
    WetRock_NormalGrass.png
    Wet rock, but normal grass


    Wetness_Insp.png


    It's the same with snow..
    SnowyRock_NormalGrass.png

    Setting the parameters directly in the inspector works though...
     
  49. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Hmmm,

    I've just imported from assetstore these 18 free subtances. Using bricks substance material I'm able to do this:

    substance_dynamic_snow.JPG

    Attached UBER shader to material. Set snow and selected all parameters of snow to be controlled globally. Works.

    Tom
     
  50. BYD

    BYD

    Joined:
    Jan 26, 2015
    Posts:
    24
    Weird, I'll try it with the same substances when I'm back home and will tell you if it works..