Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Unity 2022.2 is now available as the latest Tech release.
    Dismiss Notice
  3. We are making some changes to the DOTS forums.
    Dismiss Notice
  4. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  5. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

[RELEASED] OmniShade - Mobile-Optimized Shader

Discussion in 'Assets and Asset Store' started by OmniShader, Feb 15, 2022.

  1. OmniShader

    OmniShader

    Joined:
    Feb 12, 2022
    Posts:
    27

    OmniShade on the Unity Asset Store

    Website | YouTube | WebGL Demo | Discord Support | Email

    OmniShade
    is a highly performant shader designed for mobile devices. It is packed with a multitude of graphics techiques allowing it to achieve almost any look from realistic to toon to anime, yet also blazingly fast due to a progressive system of calculating only what it needs to for any setting.

    It was designed to bridge the gap between Unity's Standard Shader and mobile shaders, but can often look even better than desktop-class shaders due to its high level of stylization, combination, and customization.

    All of the sample images above were rendered using only OmniShade. It can achieve almost any look, can be used for games with complex or simple lighting -- regardless, the performance is always optimal. It is quite possibly the only shader you will need for your entire game.

    Feature summary
    All of the below can be used in any combination with optimal performance!
    On top of this, you also get:
    • Built-In and URP pipeline support
    • Progressively adaptive performance
    • Set of demo scenes
    • Full source code, easily extendable
    It's true, the Standard Shader is still too slow for mobile devices. And let's face it, giving an artist Shader Graph is like giving a baby a gun. But it doesn't mean you have to settle for Diffuse shader.


    OmniShade on the Unity Asset Store

    Website | YouTube | WebGL Demo | Discord Support | Email
     
    Last edited: Nov 4, 2022
    frbrz likes this.
  2. kenlem

    kenlem

    Joined:
    Oct 16, 2008
    Posts:
    1,630
    Great set of shaders. Bought it on sight.

    What does Progressively adaptive performance mean?
     
  3. OmniShader

    OmniShader

    Joined:
    Feb 12, 2022
    Posts:
    27
    Thank you!
    It means the shader will compile into different variants depending on what features you enable.
    So, if you only use Diffuse and Rim Lighting, a minimal shader will be generated just for that to run on the GPU. If you were to add Normal Map, a little more code will be generated and another shader will be made for that variation. It detects what you use, and always creates the minimal GPU code necessary for optimal performance.
     
  4. zinnercircus

    zinnercircus

    Joined:
    Jul 13, 2013
    Posts:
    5
    This Shader makes even the editor faster! I'm loving it but developing for the Quest 2 and having issues when I run it. Seems like it's only running in one eye and having clipping issues, did I mess something up? I am STOKED to use this Shader almost exclusively if I can figure out what my silly issue is lol thanks in advance!
     
  5. OmniShader

    OmniShader

    Joined:
    Feb 12, 2022
    Posts:
    27
    Unfortunately I've never tested this shader on a VR device, although I've heard of one other person use it successfully in VR..

    There are some depth and culling settings at the bottom of the shader which control the visibility.
    I would start with those, like try set Culling to Off, Z Write to Off, Z Test to Always, and see if it makes a difference.
     
  6. kenlem

    kenlem

    Joined:
    Oct 16, 2008
    Posts:
    1,630
  7. OmniShader

    OmniShader

    Joined:
    Feb 12, 2022
    Posts:
    27
    Thanks for sharing that Ken.

    Shader doesn't support Single-Pass stereo rendering,
    so if you have problems in VR, one thing to try is keep it on Multi Pass.
     
  8. kenlem

    kenlem

    Joined:
    Oct 16, 2008
    Posts:
    1,630
    That's a pretty big ask.

    My current project is on multi pass at the moment because I use mirror shader that requires it. It's not ideal and I have plans to change that.

    Multipass is going to be a deal breaker for a lot of VR devs.
     
  9. OmniShader

    OmniShader

    Joined:
    Feb 12, 2022
    Posts:
    27
    Yes, I just released a patch to support Single Pass Stereo Rendering. Thanks for the suggestion!
     
    Last edited: Mar 8, 2022
    lclemens likes this.
  10. zinnercircus

    zinnercircus

    Joined:
    Jul 13, 2013
    Posts:
    5
    WOW! Awesome thank you so much! going to test it now! SUPER STOKED!!!!


    .. Works perfect THANK YOU AGAIN! :)
     
    Last edited: Mar 10, 2022
  11. sipon

    sipon

    Joined:
    Feb 8, 2009
    Posts:
    140
    Hi, could we have an option on the triplanar shader to use UV0 on the main texture? ( so make moss/snow/etc.... with triplanar top ?)
     
  12. sipon

    sipon

    Joined:
    Feb 8, 2009
    Posts:
    140
    After updating to lastest version I got this error :
    Shader error in 'OmniShade/Triplanar URP': invalid subscript 'viewReflectDir' at Assets/Shaders/OmniShade/Shaders/OmniShadeCore.cginc(911) (on d3d11)
     
  13. OmniShader

    OmniShader

    Joined:
    Feb 12, 2022
    Posts:
    27
    That's a great suggestion, I'll add support for using UV0 on the main tex in triplanar.
    Also, thanks for the error report, will be fixed in the next patch, out later this week.
     
    Last edited: Mar 15, 2022
  14. sipon

    sipon

    Joined:
    Feb 8, 2009
    Posts:
    140
    Hi, just updated and I now got 2 error on Standard URP :

    Shader error in 'OmniShade/Standard URP': 'reflect': no matching 2 parameter intrinsic function; Possible intrinsic functions are: reflect(floatM|halfM|min10floatM|min16floatM, floatM|halfM|min10floatM|min16floatM) at Assets/Shaders/OmniShade/Shaders/OmniShadeCore.cginc(810) (on d3d11)

    Shader error in 'OmniShade/Standard URP': undeclared identifier 'adjNor_world' at Assets/Shaders/OmniShade/Shaders/OmniShadeCore.cginc(810) (on d3d11)


    Unity 2020.3.29 - URP 10.8.1
     
  15. OmniShader

    OmniShader

    Joined:
    Feb 12, 2022
    Posts:
    27
    Thanks for the bug report, indeed you are correct!
    I will have it fixed early next week.

    In the meantime, you can workaround this by simply enabling the Diffuse, Rim Light, MatCap, or Specular feature, or remove the normal map and that should make the error go away.
     
  16. sipon

    sipon

    Joined:
    Feb 8, 2009
    Posts:
    140
    Great thanks!
     
  17. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    874
    Really cool assets!
    Hope you are bringing more of the "mobile features" like triplanar mapping and vertex swaying for vegetation, to the PBR version too :)

    Another cool feature would be tessellation.. but I should stop dreaming now, haha.
     
    Last edited: Mar 26, 2022
  18. mthawley

    mthawley

    Joined:
    Sep 7, 2018
    Posts:
    100
    Unity 2021.3.0f1
    Android (for Oculus Quest 2)

    I have updated my project from 2020.3 (which works fine) but when building the project I get the following error message. I have reimported the asset but still get the same message.

    Shader error in 'OmniShade/Standard URP': undeclared identifier 'Luminance' at Assets/OmniShade/Shaders/OmniShadeCore.cginc(958) (on gles3)

    Compiling Subshader: 0, Pass: Pass 3, Vertex program with BASE_SATURATION STEREO_MULTIVIEW_ON _DETAILBLEND_MULTIPLY _DETAILUV_UV1 _HEIGHTCOLORSBLEND_ALPHA_BLEND _LAYER1BLEND_ALPHA_BLEND _LAYER2BLEND_ALPHA_BLEND _LAYER3BLEND_ALPHA_BLEND _MATCAPBLEND_MULTIPLY
    Platform defines: SHADER_API_GLES30 SHADER_API_MOBILE UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_LIGHTMAP_DLDR_ENCODING UNITY_NO_CUBEMAP_ARRAY UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_RGBM UNITY_NO_SCREENSPACE_SHADOWS UNITY_PASS_META UNITY_PBS_USE_BRDF3
    Disabled keywords: BASE_CONTRAST CUTOUT DETAIL DETAIL_CONTRAST DETAIL_LIGHTING DETAIL_VERTEX_COLORS EMISSIVE_MAP HEIGHT_COLORS HEIGHT_COLORS_TEX INSTANCING_ON LAYER1 LAYER2 LAYER3 MATCAP MATCAP_CONTRAST TRANSPARENCY_MASK TRANSPARENCY_MASK_CONTRAST UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHTMAP_RGBM_ENCODING UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_PBS_USE_BRDF1 UNITY_PBS_USE_BRDF2 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_VIRTUAL_TEXTURING VERTEX_COLORS VERTEX_COLORS_CONTRAST _DETAILBLEND_ADDITIVE _DETAILBLEND_ALPHA_BLEND _DETAILBLEND_MULTIPLY_LIGHTEN _DETAILUV_UV2 _HEIGHTCOLORSBLEND_ADDITIVE _HEIGHTCOLORSBLEND_LIT _LAYER1BLEND_ADDITIVE _LAYER1BLEND_MULTIPLY _LAYER1BLEND_MULTIPLY_LIGHTEN _LAYER2BLEND_ADDITIVE _LAYER2BLEND_MULTIPLY _LAYER2BLEND_MULTIPLY_LIGHTEN _LAYER3BLEND_ADDITIVE _LAYER3BLEND_MULTIPLY _LAYER3BLEND_MULTIPLY_LIGHTEN _MATCAPBLEND_MULTIPLY_LIGHTEN
     
  19. OmniShader

    OmniShader

    Joined:
    Feb 12, 2022
    Posts:
    27
    mthawley, thanks for the report. I think I found the problem and am submitting a patch for it.

    If you rather not wati for the patch, you can fix it by simply deleting line 348 in OmniShade URP.shader
    Code (CSharp):
    1.             #pragma shader_feature BASE_SATURATION
     
  20. mthawley

    mthawley

    Joined:
    Sep 7, 2018
    Posts:
    100
    Excellent thanks!
     
  21. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    453
    I have a MASSIVE scene I'm working with for a Windows/MacOS release and have done everything I can to optimize; texture atlasing, different types of batching, etc. all using the Standard Shader. I was going to move over and give the Standard Unlit or Mobile shaders a try but I was just wondering if OmniShade might give better results on a Desktop platform.
     
  22. OmniShader

    OmniShader

    Joined:
    Feb 12, 2022
    Posts:
    27
    jnbbender, yes absolutely OmniShade is much faster than Standard shader on PC, and has a lot more features than the Mobile shaders. It would definitely be worth a try if you need the performance. The main thing it lacks compared to Standard shader is PBR (physically based rendering), so your results would not look as realistic since you’d need to tune the diffuse/specular/reflection amounts manually. But if performance is prioritized over photorealism, then OmniShade would definitely offer more.
     
  23. Bwacky

    Bwacky

    Joined:
    Nov 2, 2016
    Posts:
    70
    Hey, small question again - does Omnishade support instanced indirect crossfade?
    It needs the LODDitheringTransition method to work with things like GPUInstancer, so I'm wondering before I bite the bullet and grab the shader.
     
  24. OmniShader

    OmniShader

    Joined:
    Feb 12, 2022
    Posts:
    27
    bwacky, I took a look into the GPUInstancer package, and it seems to require some modifications for custom shaders to work:
    https://wiki.gurbu.com/index.php?title=GPU_Instancer:FAQ#Vertex.2Ffragment_Shaders

    So, to answer your question, no it is not supported out of the box, although if you follow the above directions, it would not seem too difficult to setup (although I can only guess without having tried it myself).
     
  25. look001

    look001

    Joined:
    Mar 23, 2017
    Posts:
    100
    Hey there, is there any chance to get spotlights working with these shaders? Do you plan to add support for it any time soon? Besides that the shaders look very nice!
     
  26. OmniShader

    OmniShader

    Joined:
    Feb 12, 2022
    Posts:
    27
    Hi look001,

    Unfortunately OmniShade does not support spot lights due to performance reasons.

    As an alternative, I would recommend using OmniShade PBR on those materials that need spotlight support.
    If all you need is a very simple spotlight and you are on Built-In pipeline, you may also try Unity Projectors.
     
  27. mthawley

    mthawley

    Joined:
    Sep 7, 2018
    Posts:
    100
    Hi. Is there a way to activate/de-activate Enable Outline via script?
     
  28. sichimi1021

    sichimi1021

    Joined:
    Jan 31, 2021
    Posts:
    6
    Does it support Deferred rendering?
     
  29. OmniShader

    OmniShader

    Joined:
    Feb 12, 2022
    Posts:
    27
  30. sichimi1021

    sichimi1021

    Joined:
    Jan 31, 2021
    Posts:
    6
    Thanks.
    I will consider PBR.
    .
     
  31. Clariesu

    Clariesu

    Joined:
    Apr 2, 2021
    Posts:
    23
    Is this a character shader? I can't get the same result after unity bake GI.
     
    d1favero likes this.
  32. onemeta

    onemeta

    Joined:
    May 26, 2022
    Posts:
    4
      • I have a problem, the material ball encountered the following error
     

    Attached Files:

  33. onemeta

    onemeta

    Joined:
    May 26, 2022
    Posts:
    4
    • I have a problem the material ball encountered the following error
     
  34. OmniShader

    OmniShader

    Joined:
    Feb 12, 2022
    Posts:
    27
    Thanks for the tip, will have those warnings fixed. They are harmless to the actual operation of the shader.
     
  35. gRtVnAUoolam1492

    gRtVnAUoolam1492

    Joined:
    Sep 17, 2016
    Posts:
    95
    hello dev!

    I recently purchased your asset to learn more about how Unity shaders operate, it is very feature complete. How can we access layers via script as material block, per instance? I have need to swap or set textures in layers per instance at runtime.

    I am reading the OmniShadeAnimateTexture.cs file, I think it will be of great help in figuring this out per instance.

    Thanks again for any information you can provide.
     
  36. OmniShader

    OmniShader

    Joined:
    Feb 12, 2022
    Posts:
    27
    Hello,

    To change the layer texture via script, you can call
    Material.SetTexture("_Layer1Tex", newTexure)


    Also, as the shader variant for Layers are detected at build time, you'll also want to ensure there is a texture slotted in there (even if just a white dummy texture) if you are setting the texture at runtime to ensure the proper variant is built.

    Thank you!
     
    gRtVnAUoolam1492 likes this.
  37. gRtVnAUoolam1492

    gRtVnAUoolam1492

    Joined:
    Sep 17, 2016
    Posts:
    95
    Thank you!
     
  38. gRtVnAUoolam1492

    gRtVnAUoolam1492

    Joined:
    Sep 17, 2016
    Posts:
    95
    hello again.. sorry

    but how would I go about making this work????

    Code (CSharp):
    1. public class SetRandomColor2 : MonoBehaviour
    2. {
    3.     SkinnedMeshRenderer r = null;
    4.  
    5.     private MaterialPropertyBlock block = null;
    6.  
    7.     void Start()
    8.     {
    9.         //var r = GetComponentInChildren<Renderer>();
    10.         //r = GetComponentInChildren<Renderer>();
    11.  
    12.         r = this.gameObject.GetComponent<SkinnedMeshRenderer>();
    13.         block = new MaterialPropertyBlock();
    14.        
    15.     }
    16.     void changeColorLayer1()
    17.     {
    18.         //
    19.         if (Input.anyKeyDown)
    20.         {
    21.             //
    22.  
    23.             r.GetPropertyBlock(block);
    24.             block.SetColor("_Layer1Tex", new Color(Random.Range(0f, 255f), Random.Range(0f, 255f), Random.Range(0f, 255f), Random.Range(0f, 255f)));
    25.    
    26.             r.SetPropertyBlock(block);
    27.         }
    28.         //
    29.     }
    30. }
    im not getting errors, per se, but nothing happens when I try it?

    im really confused, i've spent quite a bit of time on it, thank you again