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
    You'd need to use padding on your extrusion texture. Still - at extreme angles we'd have the same occlusion artifacts.

    Tom
     
  2. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I know it is supposed to be uber, so the performance cost is probably more than just a standard unity shader, but if we set things up so they are on par with feature wise (which sort of then makes no sense to use uber but for comparison sake ) how does uber shader's performance like?

    Is is just a standard unity shader + extra on top performance? or does uber do something magical to make the performance of standard unity shader to shame? :D

    And has the asset been tested on XboxOne and PS4 yet?

    Thanks
     
  3. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I believe it should work on XB1 and PS4. Anyway I've got some experience in maintaing my products to work with consoles (for example RTP). If you don't use expensive features like POM or wetness/snoww alltogether you can expect quite similar performance. UBER awdds just a little bit on top of Unity Standard Shader.

    Tom
     
  4. local306

    local306

    Joined:
    Feb 28, 2016
    Posts:
    155
    Hello. I'm working on modular pieces of a hedge garden, and I am using the UBER triplanar selective shader such that I can use world mapping and having the pieces fit together.

    Unfortunately though, I am getting some weird edge artifacting that looks like this:



    The geometry was made in Blender, and the entire body is set to smooth. This face's edges are marked as sharp to keep it flat because it is modular and will match up with another shape.

    Is there anything I can do to have the triplanar shader project evenly across this geometry?
     
  5. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    The plane of mapping is selected via local/world normal - if your mesh has shared normals at left side which means we've got them interpolated we'll encounter such problems - geometry itself and mesh normals doesn't match (first has hard edge while mesh normals are "smoothen"). You can compare the same placing such UBER shader variant on Unity cube - should be w/o artifacts (of course mapping will expose discontinuity simply because cube edges don't have continuous smooth edges either).

    Tom
     
  6. vivredraco

    vivredraco

    Joined:
    Jan 19, 2016
    Posts:
    22
    Does UBER shader enhance the base standard shader features, or only add new ones? In other words, will switching to UBER shader look immediately better than the Unity standard shader, or will there be no real difference unless additional maps are added to take advantage of POM, etc.?
     
  7. local306

    local306

    Joined:
    Feb 28, 2016
    Posts:
    155
    Thanks @tomaszek! I followed your advice and things are looking the way I want them to now :)

     
  8. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    It's basically StandardShader, but you've got a few features that might enhance look depending on what you need to shade. For example - diffuse scatter immediately (its textureless feature) can bring better look to velvet like materials. Glitter can enhance mineral or metal materials. POM uses heightmaps which are also needed fo parralax effect in Unity Standard Shader. So - generally you don't need any special kind of texture to use UBER. Simply change the sahder to UBER and tweak params to taste. Another feature is translucency - works pretty well on ice or vegetation (it's not any kind of SpeedTree or grass replacement though).

    Tom
     
  9. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    i am not able to pull it off could you be a bit more specific!?

    this is the mentioned example
     
    Last edited: May 4, 2017
  10. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    With this shader variants you can control transparency with vertex color alpha together with heightmap:

    GeomBlend.jpg

    Tom
     
  11. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    the geom blend core has no pom and has no cutout mode ... much closer is the pom advanced almost everything a decal needs but it does not take vertexcolor into account. do you think you could add a proper decal shader in later version!?
     
  12. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Isn't it feature you request for ?

    geomBlendPOM.JPG

    Has POM working with soft self-shadowing working.

    Classical decal is kind of transparent shader sticked to underlyin geometry - that's what geomblend can do. With terrain it can blend with heightmap. You can disable it if not used with terrain. In shader code there are defines:

    #define GEOM_BLEND
    #define BLENDING_HEIGHT 1

    set BLENDING_HEIGHT to 0

    Customizing a transparent UBER shader that takes transparency from both vettex color (like geom blend vetex alpha channel) would be not difficult either.

    Tom
     
  13. local306

    local306

    Joined:
    Feb 28, 2016
    Posts:
    155
    Hi @tomaszek, sorry to bug you again. Is there a way to change the projection angle of the triplanar shader? Some of my geometry lies at 45 degrees and the projection just produces a solid fill colour such as this:



    Even if it was 1 degree different, it would fix this. I'm hoping I can do this via the shader as oppose to changing all of my geometry by 1 degree if at all possible.

    Thanks in advance :)
     
  14. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Yes, exact 45deg is "undefined" result for selective triplanar. In UBer_StandardCore.cgtinc ech renderin path has its own vertex function (forward, forward additive for additional light, deferred) you can search for vertex normals taken from mesh (like v.normal) and alter them it a bit so subsequent triplanar routines can handle it. Remember to recompile actual shader after modifuing cginc file because it stays in different folder (saving cginc alone won't recompile shaders).

    Tom
     
  15. local306

    local306

    Joined:
    Feb 28, 2016
    Posts:
    155
    Thanks for the reply @tomaszek.

    I looked through the .cginc as suggested and tried a few things to manipulate these values. Unfortunately, I didn't find any success (or any change for that matter).

    Would you be willing to offer a little more help with how to accomplish this? My shader knowledge is pretty sparse :(
     
  16. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Just throwing it out there but would it not be easier to just make all your level pieces a child and rotate the parent by 0.001 or something? seems pretty trivial and can be done in a Start method.
     
    tomaszek likes this.
  17. local306

    local306

    Joined:
    Feb 28, 2016
    Posts:
    155
    @hippocoder Yes and no. The problem is that even at 0.5 degree rotation (seems to be roughly the smallest amount to make the triplanar problem disappear) of the parent propagates into a ~0.5 unit delta on the far end of the maze for a play space that is ~50 units deep. That's enough delta to cause havoc for other entities that need to connect to the far side of the maze.

    Therefore, if I can, I'd like to solve this via the shader rather than having to rewrite the code that handles the modular geometry placement.
     
  18. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    thanks this works! sure i could customize shaders and stuff but since it is a common shader usecase maybe you consider to do a seperate "shader" for it. adjusting the falloff and so on would be great as well.
     
  19. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    @tomaszek - Greetings Tom - lame feature request here. :p I'm on a new but similar project to my other one and I am once again finding the need for TriPlanar shader action. Your RTP is great for terrains and Uber TriPlanar selective is great for performance. However, we have some materials that require a 2 or 3 side TriPlanar. Since Uber doesn't have this we end up using Alloy in addition to Uber only for the TriPlanar, where we would prefer to just use Uber on all of it and skip Alloy and some other shader packs all together. Any chance of adding a full TriPlanar shader with the 3 sides option (Top, Side and Bottom) to Uber? I personally would like to stick with only Uber and currently find this to be the only missing shader for our particular situations. Thanks for the consideration and great products!
     
    2freed0m likes this.
  20. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Can take it for consideration, but believe me - I'm so burried with work (which will be soon revealed in cooperation with Unity), I can't even roughly schedule any UBER updates.

    Tom
     
    hopeful, SAOTA and Tethys like this.
  21. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Awesome man, cant wait to see what you've been working on! No worries, thanks for listening.
     
  22. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    Hey how can i make fog work?
    I'm using uber core tesselation shader and fog is not working - but it works with the standard unity shader in the same setup. are there any parameters to turn fog on ?
     
  23. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    To reduce shader variants compiled I hardcoded fog type. Look at UBER_ForwardFogType.cginc file and select right fog type by uncommenting it. Then recompile (reimport) shaders folder.

    Tom
     
    vladstorm_ likes this.
  24. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    In order for fog to work in Forward rendering I enabled the fog in the cginc file as indicated in the docs. The fog works great in game view and during runtime, but when viewing in the scene view objects are completely white. This is very problematic because now it's basically impossible to adjust the various UBER shader parameters such as dynamic snow because I can't see the effect until I run the game. Is there any way to fix this? I'm running Unity 5.5.3f1.

    [EDIT]
    Nevermind. I figured it out. If I have Fog turned off in the editor scene view then it shows white, but if I turn Fog on in scene view then it works. Sorry to have bothered you. But hopefully this helps someone else down the road.

    [EDIT 2]
    There is one other related issue though. If you click on an object with UBER shader, then it shows up all white in the Unity 3D preview window. So that's a bit of a problem still.
     
  25. VRStudios

    VRStudios

    Joined:
    Apr 24, 2017
    Posts:
    2
    Do it work well with VR?
     
  26. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Like Unity standard shader does. With previous updates I fixed a few glitches around deferred vs. UBER translucency in VR, but now I've been not reported about any trobules for some time.

    Tom
     
  27. drsalvation

    drsalvation

    Joined:
    May 2, 2014
    Posts:
    48
    Hello! I'm not sure if someone else has asked this question before, but whenever I use a two-sided shader with a cloth component, I get some strange effects... I realized it's also because of the camera effects that involve blur (like chromatic aberration), but I'm curious if there's some way to prevent this from happening?

    Nevermind, it's not UBER, I tried with the standard shader and it still happens... it's just something about the cloth component with other Unity settings...
     

    Attached Files:

    Last edited: May 31, 2017
  28. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    While looking for some random performance issues I captured this very large performance spike with UBER:

    upload_2017-6-1_6-37-35.png

    Continuing to run, I found other spikes for other issues, but not too longer after I got another one for UBER:

    upload_2017-6-1_6-42-58.png

    Any ideas why this would happen?

    [EDIT]
    Now I see that it does this for other sahders as well. Researching it it looks like a possible solution would be to pre-load shaders, but I can't seem to get that to work. When I go to graphics settings and add empty elements to the Preloaded Shaders array, it won't let me drag the shaders in there. Trying to find out how that's supposed to work.

    [EDIT2 ]
    I figured out how to do the shader preloading.
     
    Last edited: Jun 1, 2017
  29. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    It's "prewarm" shader stage. Unity doesn't compile them to low-level GPU code. It's a bit "higher abstract lavel" so that it works on any GPU (that's target compatible like DX11). AFAIK it's done via GPU driver and it takes time. Yes, we can name it "loading shaders".

    Tom
     
  30. LukaKotar

    LukaKotar

    Joined:
    Sep 25, 2011
    Posts:
    394
    I'm experiencing a crash when using Vulkan (on Linux, but I haven't tested other platforms). The crash happens while loading if the scene uses one or more shaders from the pack.

    Here is the player log from a test project:
    Code (CSharp):
    1. Desktop is 1920 x 1200 @ 59 Hz
    2. [Vulkan init] extensions: count=12
    3. [Vulkan init] extensions: name=VK_KHR_surface, enabled=1
    4. [Vulkan init] extensions: name=VK_KHR_xcb_surface, enabled=0
    5. [Vulkan init] extensions: name=VK_KHR_xlib_surface, enabled=Preloaded type GtkListStore
    6. Preloaded type GtkWindow
    7. Preloaded type GtkVBox
    8. Preloaded type GtkImage
    9. Preloaded type GtkNotebook
    10. Preloaded type GtkHBox
    11. Preloaded type GtkFrame
    12. Preloaded type GtkAlignment
    13. Preloaded type GtkTreeView
    14. Preloaded type GtkLabel
    15. Preloaded type GtkCheckButton
    16. Preloaded type GtkScrolledWindow
    17. Preloaded type GtkComboBox
    18.  
    19. Native stacktrace:
    20.  
    21.    /home/luka/Documents/Test/test_Data/Mono/x86_64/libmono.so(+0x91be1) [0x7fe9c9f0dbe1]
    22.    /lib/x86_64-linux-gnu/libpthread.so.0(+0x1138f) [0x7fe9d1a8a38f]
    23.    /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38) [0x7fe9d0c3c428]
    24.    /lib/x86_64-linux-gnu/libc.so.6(abort+0x169) [0x7fe9d0c3e029]
    25.    /home/luka/Documents/Test/test.x86_64() [0x9edffb]
    26.    /home/luka/Documents/Test/test_Data/Mono/x86_64/libmono.so(+0xd0c42) [0x7fe9c9f4cc42]
    27.    /home/luka/Documents/Test/test_Data/Mono/x86_64/libmono.so(+0x349d3) [0x7fe9c9eb09d3]
    28.    /lib/x86_64-linux-gnu/libpthread.so.0(+0x1138f) [0x7fe9d1a8a38f]
    29.    /home/luka/Documents/Test/test.x86_64() [0x9387fb]
    30.    /home/luka/Documents/Test/test.x86_64() [0x12e162c]
    31.    /home/luka/Documents/Test/test.x86_64() [0x12dcbd3]
    32.    /home/luka/Documents/Test/test.x86_64() [0x1246bf2]
    33.    /home/luka/Documents/Test/test.x86_64() [0x124c41a]
    34.    /home/luka/Documents/Test/test.x86_64() [0x12417c6]
    35.    /home/luka/Documents/Test/test.x86_64() [0x8dcd27]
    36.    /lib/x86_64-linux-gnu/libpthread.so.0(+0x76b9) [0x7fe9d1a806b9]
    37.    /lib/x86_64-linux-gnu/libc.so.6(clone+0x6c) [0x7fe9d0d0d82c]
    38.  
    39. Debug info from gdb:
    40.  
    41. Could not attach to process.  If your uid matches the uid of the target
    42. process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
    43. again as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf
    44. ptrace: Operation not permitted.
    45. No threads.
    46.  
    47. =================================================================
    48. Got a SIGABRT while executing native code. This usually indicates
    49. a fatal error in the mono runtime or one of the native libraries
    50. used by your application.
    51. =================================================================
    52.  
    53. ons: name=VK_KHR_sampler_mirror_clamp_to_edge, enabled=0
    54. [Vulkan init] extensions: name=VK_KHX_device_group, enabled=0
    55. [Vulkan init] extensions: name=VK_KHX_external_memory, enabled=0
    56. [Vulkan init] extensions: name=VK_KHX_external_memory_fd, enabled=0
    57. [Vulkan init] extensions: name=VK_KHX_external_semaphore, enabled=0
    58. [Vulkan init] extensions: name=VK_KHX_external_semaphore_fd, enabled=0
    59. [Vulkan init] extensions: name=VK_KHX_multiview, enabled=0
    60. [Vulkan init] extensions: name=VK_EXT_discard_rectangles, enabled=0
    61. [Vulkan init] extensions: name=VK_EXT_shader_subgroup_ballot, enabled=0
    62. [Vulkan init] extensions: name=VK_EXT_shader_subgroup_vote, enabled=0
    63. [Vulkan init] extensions: name=VK_EXT_display_control, enabled=0
    64. [Vulkan init] extensions: name=VK_NV_dedicated_allocation, enabled=0
    65. [Vulkan init] extensions: name=VK_NV_glsl_shader, enabled=0
    66. [Vulkan init] extensions: name=VK_NVX_device_generated_commands, enabled=0
    67. [Vulkan init] extensions: name=VK_NVX_multiview_per_view_attributes, enabled=0
    68. Vulkan API version 1.0.42
    69. Vulkan vendor=[NVIDIA] id=[10de]
    70. Vulkan renderer=[GeForce GTX 760] id=[1187]
    71. Vulkan device type 2
    72. Vulkan driverversion=[0x5f458000] uint=[1598390272]
    73. Vulkan: default RenderTexture HDR format: 11 (109)
    74. Vulkan PSO: cache data not found [path=/home/luka/.cache/unity3d/DefaultCompany/Test/vulkan_pso_cache.bin]
    75. AudioManager: Using PulseAudio: Default Output Device
    76. Begin MonoManager ReloadAssembly
    77. Platform assembly: /home/luka/Documents/Test/test_Data/Managed/UnityEngine.dll (this message is harmless)
    78. Loading /home/luka/Documents/Test/test_Data/Managed/UnityEngine.dll into Unity Child Domain
    79. Platform assembly: /home/luka/Documents/Test/test_Data/Managed/Assembly-CSharp.dll (this message is harmless)
    80. Loading /home/luka/Documents/Test/test_Data/Managed/Assembly-CSharp.dll into Unity Child Domain
    81. Platform assembly: /home/luka/Documents/Test/test_Data/Managed/UnityEngine.UI.dll (this message is harmless)
    82. Loading /home/luka/Documents/Test/test_Data/Managed/UnityEngine.UI.dll into Unity Child Domain
    83. Platform assembly: /home/luka/Documents/Test/test_Data/Managed/UnityEngine.Networking.dll (this message is harmless)
    84. Loading /home/luka/Documents/Test/test_Data/Managed/UnityEngine.Networking.dll into Unity Child Domain
    85. - Completed reload, in  0.009 seconds
    86. Platform assembly: /home/luka/Documents/Test/test_Data/Managed/System.Core.dll (this message is harmless)
    87. Platform assembly: /home/luka/Documents/Test/test_Data/Managed/System.dll (this message is harmless)
    88. requesting resize 1920 x 1200
    89. Using native desktop resolution 1920 x 1200
    90. requesting fullscreen 1920 x 1200 at 0 Hz
    91. Desktop is 1920 x 1200 @ 59 Hz
    92. InitializeOrResetSwapChain 1920x1200 samples=1
    93. Using present mode 2
    94. UnloadTime: 0.555000 ms
    95. Changing real window size to 1920 x 1200
    96. InitializeOrResetSwapChain 1920x1200 samples=1
    97. Using present mode 2
    98. Setting up 4 worker threads for Enlighten.
    99.   Thread -> id: 7fe92affc700 -> priority: 1
    100.   Thread -> id: 7fe92b7fd700 -> priority: 1
    101.   Thread -> id: 7fe92a7fb700 -> priority: 1
    102.   Thread -> id: 7fe929ffa700 -> priority: 1
    103. Receiving unhandled NULL exception
    104. #0  0x007fe9b1858f80 in funlockfile
    105. #1  0x007fe9b1859530 in std::vector<core::basic_string<char, core::StringStorageDefault<char> >, std::allocator<core::basic_string<char, core::StringStorageDefault<char> > > >::~vector()
    106. #2  0x007fe9b1859580 in std::multimap<unsigned int, DeferredSkinningOperation, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, DeferredSkinningOperation> > >::~multimap()
    107. #3  0x007fe9b1859660 in std::multimap<unsigned int, DeferredSkinningOperation, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, DeferredSkinningOperation> > >::~multimap()
    108. #4  0x007fe9b18596d0 in std::map<core::basic_string<char, core::StringStorageDefault<char> >, core::basic_string<char, core::StringStorageDefault<char> >, std::less<core::basic_string<char, core::StringStorageDefault<char> > >, std::allocator<std::pair<core::basic_string<char, core::StringStorageDefault<char> > const, core::basic_string<char, core::StringStorageDefault<char> > > > >::~map()
    109. #5  0x007fe9b1859ed0 in std::map<core::basic_string<char, core::StringStorageDefault<char> >, core::basic_string<char, core::StringStorageDefault<char> >, std::less<core::basic_string<char, core::StringStorageDefault<char> > >, std::allocator<std::pair<core::basic_string<char, core::StringStorageDefault<char> > const, core::basic_string<char, core::StringStorageDefault<char> > > > >::~map()
    110. #6  0x007fe9b1859ef0 in std::map<core::basic_string<char, core::StringStorageDefault<char> >, core::basic_string<char, core::StringStorageDefault<char> >, std::less<core::basic_string<char, core::StringStorageDefault<char> > >, std::allocator<std::pair<core::basic_string<char, core::StringStorageDefault<char> > const, core::basic_string<char, core::StringStorageDefault<char> > > > >::~map()
    111. #7  0x007fe9b1859f00 in std::vector<core::basic_string<char, core::StringStorageDefault<char> >, std::allocator<core::basic_string<char, core::StringStorageDefault<char> > > >::~vector()
    112. #8  0x007fe9b1859f20 in start_thread
    113. #9  0x007fe9b1859fc0 in clone
     
  31. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Looks like something crash just around enlighten do the job for GI. It might be not related though. Would like to help you, but that's beyond the control I've got over Unity rendering. If shader works wrong or at least we have any suspisious (warnings/errors) output from shader compiler in Unity I can try to fix it. In such case it's rather something Unity need to take a look. All you can do is issung bug report. Does it happen in editor or build ? Which Unity/UBER version ? I could ask assetstore tech assistant if he can reproduce the crash.

    Tom
     
  32. LukaKotar

    LukaKotar

    Joined:
    Sep 25, 2011
    Posts:
    394
    Vulkan is not supported in the editor, so only build. Works as intended in OpenGL.
    I use Unity 5.6.1f1 and UBER 1.2c (latest).

    I have reported the bug to Unity as you suggested.

    Edit: The Unity team has responded, informing me that the bug was fixed in the latest beta version of Unity.
     
    Last edited: Jun 8, 2017
  33. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    a really nice bonus of this asset is the candle setup.. i do use it in a project. problem is you want to go close to the flame and as it is with close ups you want some dof. flame transparent shader is not writing to depth buffer. could we have a cutout version of it? tried to change the code without any success.
     
  34. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Looked into the topic. I guess the best solution is to write depth first via separate pass. Duplicate Candle flame material and assign the shader below to it:

    Code (csharp):
    1.  
    2. Shader "UBER - Bonus/CandleFireDepth" {
    3. Properties {
    4.    _WavingTex ("Wave tex", 2D) = "grey" {}
    5.    _YBottomOffset ("Y bottom offset", Float) = 0
    6.    _Freq ("Wave frequency", Vector) = (0.1,0.1,0.1,0)
    7.    _Amp ("Wave amplitude", Vector) = (0.1,0.1,0.1,0)
    8.    _AmpVertex ("  Amp along Z", Vector) = (0,0,1,0.1)
    9.    _AnimSpeed ("Anim speed", Vector) = (0.1,0.1,0.1,0)
    10. }
    11.  
    12. Category {
    13.    Tags { "Queue"="Geometry+2" "IgnoreProjector"="True" "RenderType"="Opaque" }
    14.    Cull Back
    15.  
    16.    SubShader {
    17.  
    18.        Pass {
    19.            Name "ShadowCaster"
    20.            Tags { "LightMode" = "ShadowCaster" }
    21.      
    22.            CGPROGRAM
    23.            #pragma vertex vert
    24.            #pragma fragment frag
    25.  
    26.            #pragma target 3.0
    27.  
    28.            #include "UnityCG.cginc"
    29.  
    30.  
    31.            sampler2D _WavingTex;
    32.            half3 _Freq;
    33.            half3 _Amp;
    34.            half4 _AmpVertex;
    35.            half3 _AnimSpeed;
    36.            half _YBottomOffset;
    37.                  
    38.            struct appdata_t {
    39.                float4 vertex : POSITION;
    40.            };
    41.  
    42.            struct v2f {
    43.                float4 vertex : SV_POSITION;
    44.            };
    45.          
    46.            v2f vert (appdata_t v)
    47.            {
    48.                v2f o;
    49.                float distAlong=v.vertex.y+_YBottomOffset;
    50.                v.vertex.x += (tex2Dlod(_WavingTex, float4((distAlong.xx+_Time.xx*_AnimSpeed.xx)*_Freq.xx,distAlong,0)).x*2-1)*_Amp.x*saturate(_AmpVertex.x*distAlong)*_AmpVertex.a;
    51.                v.vertex.y += (tex2Dlod(_WavingTex, float4((distAlong.xx+_Time.xx*_AnimSpeed.yy)*_Freq.yy,distAlong,0)).x*2-1)*_Amp.y*saturate(_AmpVertex.y*distAlong)*_AmpVertex.a;
    52.                v.vertex.z += (tex2Dlod(_WavingTex, float4((distAlong.xx+_Time.xx*_AnimSpeed.zz)*_Freq.zz,0,0)).x*2-1)*_Amp.z*saturate(_AmpVertex.z*distAlong)*_AmpVertex.a;
    53.                o.vertex = UnityObjectToClipPos(v.vertex);
    54.                return o;
    55.            }
    56.  
    57.            half4 frag (v2f i) : SV_Target
    58.            {
    59.                return 0;
    60.            }
    61.            ENDCG
    62.        }
    63.    }  
    64. }
    65. }
    66.  
    Set shadow casting for flame gameobject to Off in MeshRenderer component (in case it's not already).
    Set number of materials on flame object to 2 (to force 2 passes) and set first material to the material clone above (to write depth first).
    Set render queue in material inspector to Geometry+2 (like 2002 or something above geometry) for depth material and transparent queue (like 3001) for original flame material. Last thing is to comment out this line in original flame shader:

    Code (csharp):
    1.  
    2. #pragma multi_compile_particles
    3.  
    Otherwise flame would fade to none due to soft particles which compare depths (and underlying depth flame pass has written into depth so depgh distance between flame and it's depth is 0).

    ATB, Tom

    P.S. Your screenshot looks quite interesting. What's the type of project you're working on ?
     
    Last edited: Jun 13, 2017
  35. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    thanks tom as soon as i am at home ill try it. its is basically archvis in this case tadao ando´s church on the water. it is still wip but as i compose the shots now this was the first issue i was encountering. if you like you can follow me on https://redd.it/6gvikg to see the progress i use ubershader for snow and several other things.
     
  36. thomasvanhaeren

    thomasvanhaeren

    Joined:
    Feb 2, 2017
    Posts:
    2
    Hello there,

    Could someone please describe in detail how I could put somehow a bit of water on a material? As in the image of the asset. I have for example a material that is metallic, and I would like to know how I could put a bit of water on it. Give it that wet feeling.

    Played a bit with Wetness in Uber -> Metallic -> Core, but that seems to just darken the texture or put droplets. Since it isn't raining, I would like just to make something a bit wet, no rain droplets. Doable?

    Also, if I would like to put this on the terrain, how could I do that? There is a swamp, and I would like to make the walkable path a bit wet somehow.

    Help a noob please :)

    What I am trying to accomplish is a bit like this image from Witcher 3. Should I use a water prefab? Or doable directly from shader?




    Thanks
     
    Last edited: Jun 14, 2017
  37. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
  38. john_mike

    john_mike

    Joined:
    Jun 19, 2017
    Posts:
    6
    Great asset! Just a small problem with dynamic snow and moving objects.

    Some part of the snow seems to be world-mapped even though the checkbox is unticked. You can see it by e.g. adding a moving capsule with metallic setup core shader and dynamic snow (default settings). Looking at it closely, the snow border is "flowing" as the object moves. The effect is more visible if you reduce the snow's color alpha, dissolve masking and slope damp.

    Is this a known issue or limitation? I'm on Unity 5.5.3 and latest UBER.
     
  39. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I'm able to reproduce your issue. As snow coverage is driven by world normal direction it seems that this parameter flows tiny bit as an object moves. Sorry, I can't give you immediate tip or fix for this.Will take it into account for future updates though.

    ATB, Tom
     
  40. john_mike

    john_mike

    Joined:
    Jun 19, 2017
    Posts:
    6
    Tom, thanks for a very quick reply! It would be nice to have this fixed in some future update (no hurry though, I can live with it).
     
  41. tomaszek

    tomaszek

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

    Are you aware of any rleased games that use UBER shaders? Would appreciate the info (here or via privae message) for promotional purposes.

    Tom
     
  42. Warsoul

    Warsoul

    Joined:
    Sep 9, 2016
    Posts:
    39
    There is a way to use yours shaders with World Creator 3 ?
     
  43. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
  44. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    a lot of uber usage
     
    tomaszek likes this.
  45. 2freed0m

    2freed0m

    Joined:
    Jun 17, 2015
    Posts:
    10
    Hi Tom.
    Thanks for that plugin, it's very nice
    But translucency (plugin ver20170531_v.1.2c) doesn't seem to work in VR, Unity version 5.6.0p3.(using: multi pass, deferred). Checked without it on the same PC, and it works just fine.
    What can I try? What kind of information do I require to solve this problem?
     
  46. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Checked UBER1.2c under U5.6.1f1 with VR set to multipass split stereo (and w/o split as well) and it works for me?

    multipass_VR.jpg

    Make sure deferred hadnling script is attached to main camera and custom deferred lighting shader (Unity/graphic settings) is set to UBER one.

    Tom
     
  47. BonsaTech

    BonsaTech

    Joined:
    Dec 22, 2015
    Posts:
    73
    Hi @tomaszek , I´m trying to achive the snow tire marks effect with your snow feature over my road mesh. Which is the best option for getting this aspect successfully?
     
  48. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Hi tom, I also found that the Translucency doesn't work for VR - in SINGLE PASS is the key. It creates a strange artifact effect. The translucency does work, just not how its supposed to.
     
  49. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    UBER doesn't operate as geometry blending "bottom" layer. Best would be probably to use my RTP to render terrain and UBER (it is delivered with geom blend shader for RTP) to render tyre marks. You could even make them "3d" (correct parallax). It won't blend normals with underlying terrain though (you can only use similar normals for tyre marks already mixed with tyre marks normals themselves).

    Tom
     
  50. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Can you cechek UBER version used? I remember already fixing singlepass issue vs. translucency in recent version.
     
    Tethys likes this.