Search Unity

UBER - Standard Shader Ultra

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

  1. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
     

    Attached Files:

  2. davysw

    davysw

    Joined:
    Jul 15, 2014
    Posts:
    17
    Okay so I'm still missing some steps here, so I'm going to go step-by-step what I'm doing and try to see where I'm going wrong.
    1: The low and hi res versions of the model in MAYA
    2: Loading the high res model
    3: Loading the low resolution model
    4: Baking Options
    5: This looks correct for a transmissive map, but it's not all colored like yours is. When I use this in Unity, I get an overly dark asset, I assume from it using the occlusion as occlusion so it's darkening those areas when they are in shadow
    6: the normals on both the high and low resolution models reverse
    7: loading in the reversed high resolution model
    8: loading in the reversed low resolution model
    9: output
    10: Here's what your map looks like. I assume you're doing some mixing in Photoshop or specific maps are going to specific channels. If so, which map goes to:
    R: ?
    G: ?
    B: ?
    A:?
    for your occlusion map, and does it need to be a specific format? Does it need to be set up in Unity a specific way?

    Additional information: I'd like to use metallic shader I saw in your documentation something should go into the Blue channel, but if it wont work well with that I could you specular.

    Thank you, hopefully this clears up where I'm going wrong or missing a step! Love this tool still, just want to make it work for me :)


    http://imgur.com/va2Emue
     
  3. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Your 5th screenshot looks like correct transmissionmap (edges of your creaters are bright because their AO computed "inside" model - reversed normals - are bright). You need to pack this B&W map into a channel of texture. It's combined (screenshot 10). R is transmission, G is AO (like in Unity Standard shader). B is not used (it's white 1 - should be constant so DXT1 compressor won't "eat" quality from RG channels).

    Which channels are used is configurable (UBER_StandardCongif.cgin to quickly share configuration or you can override them in every shader - look at its code #define keywords in CGINCLUDE ... ENDCG section).

    Tom

    Tom
     
  4. davysw

    davysw

    Joined:
    Jul 15, 2014
    Posts:
    17
    this is what I needed, thanks!
     
  5. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I hope you found texture channel mixer button at the top of every UBER material inspector. It's intended to do such combination textures.

    Tom
     
  6. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I am trying to use height maps with UBER but it doesn't seem to have any affect. When I have Standard shader turned on, I can clearly see a change in the appearance when I move the height map slider from min to max, but absolutely nothing in UBER. So, I tried turning on Parallax Occlusion Mapping to see if that did anything, but same result. No matter what I change there appears to be no difference. I am using the Metallic Core shader. Any ideas what could be wrong?
     
  7. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    The only missing element is you haven't read my pdf doc yet... :). UBER uses alpha channel for heightmaps, not G channel like StandardShader does. You can change this behaviour in my config file or per shader (look at shader code). The reason is that you can encode texutres into Alpha8 which is meant to have better performance in comparison to DXT1 which would be picked by default with B&W texture. Make sure your texture has alpha channel. From regular B&W png/jpg you can ask Unity to take alpha from graysacle. Then - use advanced import settings and select Alpha8 as compression scheme.

    Tom
     
  8. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Well, I admit I didn't read the entire document from start to finish, but doing searches on height map or heightmap doesn't turn up any information on using alpha channels for them. I also can't find anything on it by searching for Alpha in the document. Can you show me what page in the document explains this?

    EDIT: Following your instructions above I was able to get it to work. But I'd still be interested in knowing where it is in the manual because I still can't find it there.
     
    Last edited: Jun 19, 2016
  9. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I can't believe I haven't mentioned this in doc :oops: ...

    Tom
     
  10. benfattino

    benfattino

    Joined:
    Nov 26, 2010
    Posts:
    43
    Is there a way to have separate uv tile for every texture?
    Thanks.

    S.
     
  11. unitydevist

    unitydevist

    Joined:
    Feb 3, 2009
    Posts:
    45
    I downloaded the 5.4 beta version from your site and it works in a fresh project but importing into a 5.3 project upgraded with UBER already in it doesn't change the shaders being pink.

    Do I need to delete the old UBER files to get the new ones to work? I don't want to break the parts of my project that use them. Is there a suggested upgrade method?

    Also, thank you for making UBER. I love the double-sided shader for dynamic cloth and the translucency to lighting, you can do amazing things with UBER.
     
  12. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I'm not sure about your question. UBER as well as Unity StandardShader can use 2 uv sets - first for main textures, 2nd for detail textures (where we can decide to use primary or secondary uvs). Using yet another uv set although possible would mean a lot of changes needed in shader and a lot of torubles in case of using lightmaps (which are handles by upper uvs).

    I can't remember if I changed file placement, but if you haven't customize UBER shaders you can reimport UBER 1.1b for U5.4 after you upgraded your project from U5.3 to U5.4. It should overwrite shader files and work. The only reason I can think about is that - overwritting cginc files which I actually changed is not enough to tell Unity to recompile shaders using changed include files. You can rightclick on shaders folder and reimport it manually. It might do the trick.

    Tom
     
  13. benfattino

    benfattino

    Joined:
    Nov 26, 2010
    Posts:
    43
    Sorry... I said that badly... Way i need is 2 uv and different tile and offset value for every texture. So i can use occlusion on uv channel 1 with tile 1-1 and diffuse in same channel with tile 5-5. Same things with normal-map or other texture.

    S.
     
  14. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    If you look at hebe model in my example scene - I use Occlusion uvs from secondary UVs. This way you can tile main maps (like rocks on your cliff model - UV0 or local/world space in case of triplanal) and have separate setup for Occlusion (UV1) to have all large scale bumps in your cliff occluded correctly. For occlusion itself you could also bake it into vertices and ask UBER to use this data instead (or in addition to) of texture. Look at beginning of the shader code there is #define OCCLUSION_VERTEX_COLOR_CHANNEL which can be set (when undefined we don't use this feature).

    Tom
     
  15. Selwakowski

    Selwakowski

    Joined:
    Jun 22, 2016
    Posts:
    1
    If you got:
    Shader error in 'UBER - Specular Setup/Tessellation/ Triplanar Selective': undeclared identifier 'samplerunity_SpecCube1' at Assets/UBER/Shaders/Includes/UBER_GlobalIllumination.cginc(191)
    open the file and replace the line 191 with this:

    half3 env1 = Unity_GlossyEnvironment(UNITY_PASS_TEXCUBE_SAMPLER(unity_SpecCube1, unity_SpecCube0), data.probeHDR[1], glossIn);

    After that pls rightclick UBER folder and reimport.
    Done.
    https://docs.unity3d.com/540/Documentation/Manual/UpgradeGuide54.html
     
    makeshiftwings likes this.
  16. KnifeMedia

    KnifeMedia

    Joined:
    Jun 15, 2015
    Posts:
    108
    Some work with the weather effects in UBER :cool:


     
  17. benfattino

    benfattino

    Joined:
    Nov 26, 2010
    Posts:
    43
    I want use UV0 for occlusion. I need use always UV0 for all map and need have separate UV TILE and OFFSET value for every map.
    I have same problem with standard shader. The only way is write my own shader or use shader forge.

    S.
     
  18. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Now I get your point. So - basically hte issue is not providing shader with seprate UVs in mesh but to set separate tiling/offset for every map type (diffuse,normal,height,spec/gloss, etc.) ? That would be possible w/o dramatic efforts, but would need shader tweaks. More than this we would need to modify shader GUI to be able enter such values.

    For every texture type you might look at UBER_StandardInput.cginc - there are functions which samples textures.
    For additional tiling you would need to declare float4 _Texture_ST; then "untile" coords in sampling function like this:

    Code (csharp):
    1. float2 originalUVs = (i.tex.xy-_MainTex_ST.zw)/_MainTex_ST.xy;
    with such value you can do your own tiling now

    Code (csharp):
    1. float2 newUVs = originalUVs * _Texture_ST.xy + _Texture_ST.zw;
    then use newUVs instead of i.tex.xy in tex2D() function calls. I hope you get the idea. Then in UBER_StandardShaderGUI.cs you need to locate place where texture slot is displayed and add tiling option to be selectable.

    A bit work but possible to do.
    To not change the regular way UBER works use #define YOUR_TILING_KEYWORD method desribed here:

    http://forum.unity3d.com/threads/uber-standard-shader-ultra.335493/page-18#post-2673287

    Tom
     
    benfattino likes this.
  19. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Hi Tomaszek. I don't know if you've followed this thread:

    http://forum-old.unity3d.com/threads/speedtree-shader-broken.399099/

    But in it a Unity dev includes some changes to Unity-StandardBRDF to fix the white leaves on SpeedTrees. You'll probably want to add those changes to UBER's deferred replacement BRDF. I put those fixes in my version and it does indeed fix the white leaves when using UBER's deferred shader.
     
    Arganth likes this.
  20. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    which one do you mean? the unity fix, mine or the "use brdf2 instead"?
     
  21. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    The Unity Dev. "Replace Uber with Lux" is not really a fix :p ;)
     
  22. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    that one is holy crap...
     
  23. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    The "kill specular on back-facing normals" one? This is the one that fixed it when ported into Uber's BRDF (which is just a cut and paste of Unity's BRDF with the new Uber stuff at the bottom) :

    It might be a pile of crap but at least it gets rid of the white leaves. Is there a better fix?
     
  24. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    real lambert lighting. as the fix provided by unity does not really fix the problem in all cases.
    but i will shut up for now. yo have followed the thread – and you should know better already.
     
  25. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Are you wanting Unity to change their shader to use real Lambert lighting, or are you trying to get everyone to switch to Lux? Because Lux looks awesome (I actually used the early version back in Unity 4) but Unity needs to have a working Standard Shader. And Uber's supposed to be "Standard Shader on Steroids" so I don't know if changing the core BRDF is something Tomasz wants to do...

    I'm not trying to start fights, I just want to fix white leaves. ;)
     
  26. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    no fights. and no need to switch to lux. as i already gave a detailed instruction in how to add "real" lambert lighting to any deferred lighting shader including uber.
     
  27. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    I totally forgot that post. Oops. :oops:

    Well then yeah Uber should use that. Though I still am a little lost as to why Unity wants to use Standard Specular instead; I thought they were implying that they can't use Lambert lighting because it won't work with vegetation or something? I don't know. You and tomasz should just sort this all out and wake me up when the leaves are green again. :cool:
     
  28. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Well, I can put this backfacing specular term fix into UBER BRDF file, no problem. For vegetation it's done like this simply because Unity implemented 2 sided leaves simple way to solve quickly "translucency" on the other side. It has drawbacks as we see. For better speedtrees I've got working version of SpeedTreeHD which is used in our incoming game. It's possible I'll make it public on AssetStore in near future (translucency solved like in UBER and no problems with 2 sided leaf specularity).

    Tom
     
  29. Dannyoakes

    Dannyoakes

    Joined:
    Feb 10, 2015
    Posts:
    118
    SpeedTreeHD? Is this just a custom SpeedTree shader? (Just curious)
     
  30. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Custom, it has some nice features :)

    SpeedTreeHD.JPG
     
  31. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    looki666, sjm-tech and Arganth like this.
  32. KarloE

    KarloE

    Joined:
    Aug 26, 2013
    Posts:
    175
    I am just wondering why the fog doesnt work with uber shader. I was searching for the fog in the config and didnt find anything. Dunno why it doesn't work, please help? :)



     
  33. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    that looks super nice!
    do you use tessellation or silhouette mapping? or something completely different?
     
  34. camel82106

    camel82106

    Joined:
    Jul 2, 2013
    Posts:
    304
    Come and get my money pls!
     
  35. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    In UBER/Shaders/UBER_ForwardFogType.cginc uncomment the fog type you'd like to use in your project, then reimport shaders (right click on shaders folder and select reimport).

    Tom
     
  36. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    It's tessellation as it introduces no problems with silhouettes and no very complex POM routines needed. I've done custom speedtree importer to process mesh for crack free seams between branches and fronds. PBR, snow/wet/translucency from UBER.

    Tom
     
    looki666 likes this.
  37. camel82106

    camel82106

    Joined:
    Jul 2, 2013
    Posts:
    304
    Any chance for topdown billboards? Many users miss this feature. Speedtree materials have needed billboards only shader is not using them.
     
    Last edited: Jul 14, 2016
  38. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    I would definitely buy this in an instant. Put it on the asset store and take my money! :p
     
  39. GingerDr73

    GingerDr73

    Joined:
    Sep 25, 2013
    Posts:
    21
    I need to add another vote of support for this! Please take my money :)
     
  40. ahimsalove

    ahimsalove

    Joined:
    Jan 27, 2016
    Posts:
    2
    Sorry. not sure if this thread is for all things about UBER shader. I just upgraded to 5.4 and my uber textures are now a lovely shade of hot pink. Is there an easy way to fix this or will I need to roll back to unity 5.3.4 thanks
     
  41. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    There is U5.4beta version of UBER 1.1b on my server.

    http://www.stobierski.pl/unity/UBERUpdate.php

    Tom
     
  42. ahimsalove

    ahimsalove

    Joined:
    Jan 27, 2016
    Posts:
    2
    Thanks for the link.
    Eventually I worked it out A simple guide would make it a lot easier. I downloaded the 4 parts, ran the package (which was 119mb) which didn't fix it.
    I then tried to delete the "UBER"folder, the: "Standard Asset/effects/ImageEffects" and "Editor/ImageEffects" which seemed to work. Hope this helps anyone else.. I'm not sure if that is what most people need to do or was just my situation. cheers. happy to have UBER running again. will have to reimport the other materials I made next.
     
  43. BreakingPointDev

    BreakingPointDev

    Joined:
    Mar 20, 2013
    Posts:
    16
    I'm having issues with 5.4 as well, I downloaded all the parts you linked but for some reason I can't extract them. When do you think you'll update UBER on the asset store to work with 5.4? Missing those awesome shaders
     
  44. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    You need to make sure you downloaded all parts (it happens that downloading could be broken before whole file is transferred). 3 Must be of the same size, last one a bit smaller.

    I hope Unity will come up with U5.4 official release (not beta) soon then I'll post it on AssetStore.

    Tom
     
  45. Drommedhar

    Drommedhar

    Joined:
    Sep 24, 2013
    Posts:
    78
    Well currently they have an RC release of Unity as a sort of beta. But I still hope the real "final" release does not take that long, so you can release the new UBER version ;D
     
  46. sgtkoolaid

    sgtkoolaid

    Joined:
    May 11, 2010
    Posts:
    899
    my shaders come in pink. :\ thoughts? is there a solution for this? I am using 5.4.0 f1

    *edit nm saw the link >drinks moar coffee :p //GLUB!
     
  47. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    am i missing something here or is there just a tesselation and no pom version for the two layer shader? and why only two layers - is it for performance reasons!?
     
  48. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    I'm having weird issues with the Refraction shaders. Currently on 5.4 beta but similar issues were popping up in 5.3. If I run towards an object with the refractive shader, the screen will flash black frames occassionally. The refractions themselves are mostly good but when moving, sometimes it will become a smudge of horizontal lines or it will show things that are in the opposite direction of where it's supposed to be refracting. I can live with the refraction artifacts I suppose but the black screen flashing is bad.
     
  49. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    Can I ask which software did you use to create that "height map" for POM shader? I can't create a good height map texture as that one.
     
  50. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Could you check if this issue is related to postFXes used ? Does it happen on my example scene after installing UBER in fresh project ?

    I used substances and grabbed these rocks textures. If you try to make heightmaps out of normalmaps Knald is the software tmight be helpful (although is not not cheap).

    Tom
     
    Crossway likes this.