Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

UBER - Standard Shader Ultra

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

  1. BIOS-S

    BIOS-S

    Joined:
    Aug 20, 2015
    Posts:
    5
    I want to know UBER performance in webgl
    thank you
     
  2. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    Test of uber + tesselation on my colum sculpted in mudbox and painted in substance painter:
    (1080p)


    The snow effect fit perfectly the model too:

    ColumnSnow.jpg
     
    Last edited: Dec 12, 2015
    nasos_333, robymv, ikazrima and 5 others like this.
  3. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    It's not easy in standard shader nor in UBER which extends it. Look at UBER_StandardCore.cginc there vertex and fragments functions are placed. Beware - the whole shader structure is not easy to follow (many functions are distributed over many functions, includes and macros). Look for vertForwardBase, vertForwardAdd and vertDeferred definitions in the file.

    I still see something like this in Unity standard shader

    #pragma exclude_renderers gles

    which means they don't work for GLES2.0. I'm not sure which platform WebGL uses, but generaly if something works OKish for DX9 it will work the same for WebGL. You can expect similar performance to Unity Standard Shader whn you don't use fancy stuff like water snow or POM. Otherwise it gets more expensive. I didn't make any real tests for WebGL though.

    Tom
     
  4. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    You know how to make my day :) (you could add just a tiny spice of glitter which works nice for orugh minreal materials like rocks). Keep up your fantastic work !

    ATB, Tom
     
  5. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    Good advice, I'll give a look to this feature !

    Edit : LOD test with tesselation:
    lod.jpg
     
    Last edited: Dec 15, 2015
    chelnok and tomaszek like this.
  6. BIOS-S

    BIOS-S

    Joined:
    Aug 20, 2015
    Posts:
    5
    I think unity in the mobile terminal advantage

    UBER hope getting better and better !!!
     
  7. droolz

    droolz

    Joined:
    Apr 29, 2009
    Posts:
    34
    Hi Tomas, any idea on these two requests?

    Cheers, Jules
     
  8. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Easy to promise, harder to find some time to make it. Translucency - current approach is not suitable for using skyboxes for translucency as we need light direction to take into account while skybox is infinitely directional (whole sphere is light emitter). I could think about something like we see skylight passing thru the object.

    For cut+transparent it's not possible with one regular shader I guess. First pass would be for example deferred while the other would be forward (transparent) and done on completely different queue (at the end). So such objects need to be rendered twice anyway - think if you can use 2 objects with different material blending modes (both using UBER) to have such effect. If you ask for genuine vegetation with vertex animations - I'd say - no (UBER would get to specialized and denominated - one user needs vegetation, other skin, other glowing particles, etc.) Go for AFS maybe if you'd like to have better foliage.

    Tom
     
  9. droolz

    droolz

    Joined:
    Apr 29, 2009
    Posts:
    34
    Hi Tom,

    Thanks, we're doing fairly high poly, high res facial stuff, so SSS / translucency becomes quite important to our workflow. these meshes have both bone and blendshape animation on them, so duplicating this is not ideal (since we'll be duplicating all the animation overhead as well as raw polycount). We're using a forward lighting setup, would it be possible to simply have two shader passes, one cutout one transparent with a dynamic queue on it? (excuse me if I'm way off, my shader knowledge is rusty).

    Translucency using sky domes would be awesome, a lookup with controllable gloss (mip levels?) would be awesome.

    Thanks for the info,

    Jules
     
  10. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Could you explain how would you like to use this 2 pass shader of facial meshes ?

    Tom
     
  11. fretnoize

    fretnoize

    Joined:
    May 24, 2013
    Posts:
    14
  12. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    This Candela SSRR is a screen space only solution, so yes, without having it tested specifically, it is compatible with every possible shader, including UBER:)
     
    fretnoize likes this.
  13. fretnoize

    fretnoize

    Joined:
    May 24, 2013
    Posts:
    14
    Thanks, I thought that'd be the case, but thought i should double check...
     
  14. droolz

    droolz

    Joined:
    Apr 29, 2009
    Posts:
    34
    Hi Tom,

    Sorry for the delay. We're doing augmented head / emotion tracking projects, overlaying 'masks' on a video feed. The overlaying often requires alpha transparency to blend the mask into the persons face (specific requirements vary mask to mask).

    On a side note, how do you control the render queue on your shaders? It's probable I'm making some stupid assumptions, but I have created a custom version of ""UBER - Specular Setup/ Core" (inside the custom shaders directory) and simply changed the queue tag:
    Code (csharp):
    1. Tags { "RenderType"="Opaque" "Queue"="Geometry+100" "PerformanceChecks"="False" "REFR"="Off" "TWO_LAYERS"="Off"}
    But this has no effect, or at least dosen't draw on top of the other shaders.

    Many thanks,

    Jules
     
  15. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Indeferred - if Candela redefines lighting internal shader it will work but you won't have UBER specific properties working (like translucency in defered). Anyway one of my friends checked this and it worked (can't tell if he used translucency). There might occur some issues due to newest U5.3 updates (that redefines a lot of things to make it possible doing SSR more effectively). I'n in hte middle of updating UBER to work with U5.3. As far as I see Candella is released Sep15th so it's probably not U5.3 ready, but I can't tell for them.Unity themselves introduce SSR.
     
    fretnoize likes this.
  16. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    If it doesn't react t render queue it might be related to lightng path (forward/transparent objects are drawn last). I also experienced sometimes Unity doesn't take Queue into account where some staticaly batched objects are on the scene. Anyway - I don't control queue - it's up to Unity, so I can't help you here.

    Tom
     
  17. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Would require tweaking Unity lighting code in forward lighting path. possible but not straightforward. Anyway - I won't introduce this in UBER, because it would not be "standard shader" anymore :).

    Tom
     
    nxrighthere likes this.
  18. BigLouis1971

    BigLouis1971

    Joined:
    Mar 26, 2014
    Posts:
    107
    I would like to know the difference between Uber Shaders and the RTP pack. Also, should I expect any troubles with RTP in Unity 5.3?
     
  19. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    RTP is meant to shade terrains. UBER is standard shaders with extensive add ons and improvements. I'll take care about U5.3 with new versions releases planned beginning of January.

    Tom
     
  20. BigLouis1971

    BigLouis1971

    Joined:
    Mar 26, 2014
    Posts:
    107
    Sorry, but I meant RSP instead of RTP. What's the difference between RSP and Uber Shaders? I'm glad to know about the RTP upgrade cause I already own it. I was wondering if I'll get a discount towards the purchase of RSP once I have Uber and RTP.
     
  21. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Edited: I figured it out about 2 minutes after posting this. I think I just had to type it all out before the solution presented itself to me. I was setting the wrong keyword. The below code is corrected and is the working version.

    Hey Tom, I am setting up a material that has a detail mask/detail albedo/metallic/normal all set at runtime and I seem to be able to get most of the values set but for some reason that material instance doesn't reflect the color changes.

    Here is the code I am using to set the values:

    Shader: UBER - Metallic Setup/Tessellation/2 Sided/ Core
    Code (CSharp):
    1.  
    2. mat.SetTexture("_DetailMask", Sail1DecalSpain);
    3. mat.SetTexture("_DetailAlbedoMap", Sail1DecalSpain);
    4. mat.SetTexture("_DetailNormalMap", mat.GetTexture("_BumpMap"));
    5. mat.SetTexture("_MetallicGlossMapDetail", mat.GetTexture("_MetallicGlossMap"));
    6. mat.SetColor("_DetailColor", Sail1DecalSpainColor);
    7.  
    8. //mat.EnableKeyword("_DETAIL_SIMPLE");
    9. //mat.EnableKeyword("_DETAIL_TEXTURED");
    10. mat.EnableKeyword("_DETAIL_TEXTURED_WITH_SPEC_GLOSS");
    11.  
    The code is running, and doesn't throw any errors but my material still doesn't reflect all of the changes:


    You can see the visible outline of the emblem, so the mask is applying, but the actual albedo doesn't appear at runtime.

    Now, if I go to that mesh in the editor (while running), select it and then expand the material instance this happens:



    So I am not sure what part I am missing to get this to finish the application at runtime. I think something in the material editor is triggering the full application of the settings but so far I cannot figure out what.
     
    Last edited: Dec 24, 2015
  22. louis2009

    louis2009

    Joined:
    Jun 4, 2013
    Posts:
    9
  23. Becoming

    Becoming

    Joined:
    May 19, 2013
    Posts:
    781
    I helped Tom with his demo, as far as i remember we only used sonic ether's natural bloom(and standard assets tonemapping after it). AFAIK, everything else is included with UBER's example scene.
     
    louis2009 likes this.
  24. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Sorry for the total noob question, but I'm trying to figure out where to start...

    Should I simply replace the Unity Standard Shader that all my materials use or do I need to be selective?

    I plan on using deferred rendering since my scenes are light count heavy. Doing it for all creates a nice standard for me to follow, but I'm not sure if there's a performance impact.
     
  25. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    RSP is predecessor of UBER. It works only for Unity4. It's still available on AssetStore because I want to give my current RSP users opportunity to upgrade to UBER for $1. (That's why RSP is $49 while UBER is $50).

    You can do it for multiple materials at once, but if you don't plan to use any specific UBER features - what's the reason you'd like to do it ? Replacing shaders in this case won't make it automatically looking better. You need to know which features you'd like to use, tweak their parameters.

    For basic features UBER is not much more expensive vcomparing to Unity Standard Shader. If you require POM with dynamic water and snow you need to expect your shading its hunger for GPU power.

    Tom
     
  26. BigLouis1971

    BigLouis1971

    Joined:
    Mar 26, 2014
    Posts:
    107
    I have 5 words to describe these shaders: awesome, awesome, awesome awesome, awesome! These shaders will take my mediocre newbie levels and make them look AAA. Thanks Tomasz for such wonderful asset!
     
  27. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Thanks Tom. Some assets are just total replacements for Unity's default. I wasn't sure if there would be a benefit (or cost) of simply using UBER all the time... even if I didn't need any thing special for some materials. But, you answered it. Thanks! :)
     
  28. chai

    chai

    Joined:
    Jun 3, 2009
    Posts:
    84
    Recently got Uber, really cool stuff :)

    1. Any way to make the parallax height effect go up/down (like standard shaders), instead of just downward ? (I have no need for silhouettes)

    2. I write custom shaders as part of my work, is it difficult to inject custom cgcode to the Uber shaders ?
    or alternatively just reuse features such as POM on my own shaders ?
     
  29. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    1. UBER_StandardUtils.cginc - ParallaxOffset1Step() function
    2. UBER_StandardCore.cginc - look around there are vertex/fragment functions placed for misc lighting paths (forward,deferred,meta)

    Tom
     
  30. chai

    chai

    Joined:
    Jun 3, 2009
    Posts:
    84
    awesome thanks ;)
     
    Last edited: Jan 1, 2016
  31. chai

    chai

    Joined:
    Jun 3, 2009
    Posts:
    84
    Ok tried the things you suggested.

    1. Actually I meant change the displacement for POM, I want the fancy lighting & shadows but don't care about silhouettes.

    2. meant injecting my own vert/frag/surface function code, doesn't seem possible am I correct ?
    I love your shaders though, would it be possible to make a duplicate of your StandardCore and set some surface function operations (specifically I want custom vertex color blending with noise)

    3. talking of which, why doesn't POM work in the "Two-layer" shader ?
     
  32. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Injecting your code is pretty much possible. Not your won functions as a whole, but you can inject your code into my vert/frag functions. To not copy core include you can use #define #ifdef keywords. Place your own specific code inside #ifdef KEYWORD ... #endif sections, copy shader and place #define KEYWORD at the top of the shader.

    POM in 2 layers mode - I didn't make it possible for many reasons. Primarialy - performance and keeping code more straightforward.

    Tom
     
  33. KnifeMedia

    KnifeMedia

    Joined:
    Jun 15, 2015
    Posts:
    108
    Hi Tom,

    I'm having some issues getting POM working. See my screenshot:



    No matter what method of POM I try to set up, none of them have any effect on my models.

    I tried putting the texture on a cube to bypass the cylindrical nature of my model, but the POM still doesn't show.

    How do I go about making POM work properly for this model? Sorry I'm a POM noob ;)
     
  34. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Check if your heoghtmap has alpha channel. We don't need RGB color channels. So - use alpha from graysacale in texture import settings and use Alpha8 encoding (select advanced as testure type first to see more options).

    Tom
     
  35. KnifeMedia

    KnifeMedia

    Joined:
    Jun 15, 2015
    Posts:
    108
    It works! And it looks really nice. I'm creating a romanesque castle demo scene with your software - I'll post some results soon.

    How does one get to know the UV coordinate system better in relation to POM? I see you are using specific POM coordinate textures for the doughnut and column models in your demos. How do I understand these?
     
  36. Yokogeri

    Yokogeri

    Joined:
    Oct 14, 2013
    Posts:
    21
    Hi Tom!

    I'm currently trying to add translucency to my characters body (especially ears). I've baked a translucency map in xNormal, but i'm not too sure where to insert it into the shader. Currently i've inserted the translucency in the "R" channel of the Ambient Occlusion map, but it does not seem to affect translucency on my character - all skin on my character gets translucent red (i changed it from white) instead of just the parts on the translucency map.

    I use deffered rendering. I've attached the correct scripts to the camera and directional light, and changed the shader to "Internal_DefferedShading_UBER". If it makes any difference, i also use GGX for the fancy specularity.

    What am i doing wrong?
     
  37. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Tom, I don't know if this problem is kno
    wn, but Uber doesn't seem to work well with Directional Specular lightmaps...
    This is a scene with Directional Specular maps baked. Everything white are Uber shaders, just the rocks in the background are standard:
    Screenshot4.jpg
    Here's the same scene with directional lightmaps (not re-baked, that's why GI is messed up):
    Screenshot3.jpg
    Do you know whats going on and is there any way to fix this?
    Seems like the specular values are extremely high...

    Edit: Might be of interest, too:
    Screenshot7.jpg
    Basically I enabled wetness and adjusted the water level so we can see both 'correct' and weird result.
     
    Last edited: Jan 3, 2016
  38. chai

    chai

    Joined:
    Jun 3, 2009
    Posts:
    84
    Thank you very much Tom, I was able to add custom blending to albedo/metallic/normal/parallax
    Really glad you kept everything consistent with standard shader, a lot of devs around overlook this !

    Parallax Blending
    Blending the parallax is trickier though (here's a test video, core shaders followed by blended ones)
    Afaik, issues caused by the parallax having ray texel offset, which doesn't line up with the planar blending.. (see code)
    Code (csharp):
    1. _h = tex2Dlod(_ParallaxMap, rayPos.xyww).PARALLAX_CHANNEL;.
    2. _h = lerp (0.5, _h, blendFade);    // I reused your blendFade for my own uses
    1. You can see the floor edges look weird in video, is it possible to make the POM effect displace in/out (overlay), instead of only inward ? (granted I don't need the "silhouette" feature)
    2. Would the above also fix the issue I have with the blending ?
    3. If not, how would you suggest to fix the blending issues ?
     
  39. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    I have the same problem. For me it seems that smothness from normal Map options is not readed right.
    I have smothness from min 0 to max 0.2 for example. This was always working fine. Starting from Unity 5.2.1 I get the really white "reflecting" results. If I change it to min 0 max 1 everything seems normal. So perhaps something is wrong with reading normal map options.
     
  40. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    When changing from 0 to 1 I get very smooth surfaces, which means they nearly look normal...
     
  41. BigLouis1971

    BigLouis1971

    Joined:
    Mar 26, 2014
    Posts:
    107
    Will Skyshop asset enhance this shader in any way? If yes, can you explain a little bit please? I also would like to know about other assets compatible with this shader.
     
  42. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I've been reported on specularity problems with lightmaps on U5.3. I will look into this next week to make quick update of UBER with a few additional improvements.

    New UBER update will make it possible to use independent translucency settings in deferred (not only color like it's currently done). So now you select only a color index in deferred that will be used and all translucency params are shared across all objects in deferred. In incoming UBER update (for U5.3) you will be able to select "setup index" not "color index" and handle 4 independent setups. So - ears will use one, snow another, foliage yet another, and so on.

    Tom
     
    Last edited: Jan 6, 2016
    Seneral likes this.
  43. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Skyshop uses it's own PBR implementatiopn while I'm relying on Unity one. They are completely indepentent products. Anyway - you will get no better shading buying Skyshop when you've got UBER.

    Tom
     
  44. BigLouis1971

    BigLouis1971

    Joined:
    Mar 26, 2014
    Posts:
    107
    Thanks Tom. It looks like I will save Skyshop money for now, at least until I'm more experienced in game development and know the specific use of Skyshop and perhaps use it for a specific project. I'm glad that I don't have to get it for now cause I was seriously thinking to get it and is more expensive than your shaders. But enough highjacking this thread with other assets lol. I owned RTP for a few months now and I bought Uber a few days ago so you can say that I'm a loyal client. I've done anything with them yet, but now I feel more confident to start to practice and also to start a project. That is thanks to other assets that I bought and of course your shaders. Thanks for the shaders cause they are great help for us newbies.

    I would like to know if you are currently working in any new asset cause I might be interested in getting it for sure. Again thanks for the shaders!
     
  45. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,689
    Not to hijack the thread ... but is there a particular reason you'd be looking at using Skyshop? I thought there was no longer a reason for using it, once Unity moved to version 5 and native PBR. But I could be mistaken.

    My understanding is you do all of the Skyshop stuff with Unity's standard shading, and then you use UBER as an extension to the Unity standard shading.
     
  46. BigLouis1971

    BigLouis1971

    Joined:
    Mar 26, 2014
    Posts:
    107
    Basically the interest is lack of knowledge because I'm a newbie and the amount of information that I need to assimilate is really massive and sometimes I get exhausted reading and learning and because of that I didn't have the time to learn that Unity's new PBR system is similar to Skyshop. Is just that I saw the demo and user's reviews and thought that it would be nice and beautiful to have those shaders in my project. Tom and now you just made things more clear by teaching me that Uber enhances Unity's native PBR system and with the combination of both I can get similar results or maybe better results than Skyshop. So I'll change my mind and will not buy Skyshop and save the money for other assets or perhaps a future Tom's asset. Thanks for the reply guys and have a wonderful evening.
     
    Last edited: Jan 6, 2016
  47. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Any luck getting Uber to work with RTP in 5.3 yet?
     
  48. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    They will fit together.

    Tom

    P.S. RTP3.3 introduces so many changes, that this is strongly recommended to remove RTP3.2 installation before going to RTP3.3.
     
    Yokogeri likes this.
  49. Sir-Spunky

    Sir-Spunky

    Joined:
    Apr 7, 2013
    Posts:
    132
    Hi,

    You might already know, but I'm getting two deprecation warnings in Unity 5.3.1p2:

    Assets/UBER/Scripts/UBER_GlobalParams.cs(323,40): 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.'
     
  50. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Yes, I know, but making it fine seems to be impossible currently (new emission object in particle system seems to not have setter for emission rate...). Tried on 5.3.1.f1, maybe they fixed this in patch. This is, however, harmless. More problematic is specularity not working fine, I'll post UBER 1.1 for U5.3 as soon as possible.

    Tom
     
    Sir-Spunky likes this.