Search Unity

UNOShader UNLIT - Property toggler inside the material editor

Discussion in 'Assets and Asset Store' started by RodneyO, May 11, 2015.

  1. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50

    click image to see demo

    UNOShader UNLIT - Property toggler inside the Material Editor

    This is a material editor extension that creates and toggles between shaders on the fly.
    It uses shader model 2.0 as a base and it was mainly designed to be used for mobile devices.

    You can toggle through these material properties:
    Color | Diffuse | Decal + Tint | Reflection | Rim | Lightmap | Emission | Vertex Colors | Outlines (normal, varied width)

    You can enable/disable these settings :
    Backface Culling | Z Sorting | Fog

    Shadows :
    Enable realtime shadows and also have the ability to choose a custom shadow color

    UV motion scripts:
    Scroll and rotate UVs scripts are built in Material Editor UI

    Render queue order:
    Adjust render queue order built in Material Editor UI

    Other:
    Transparent master slider | transparent Edges (normal/inverted) | HDR compatible | Blend Ambient/Main directional light

    --- Current Version 1.3 -----------------------------------------------
    Added support for 4.6 to 5.0 upgrade (read text file for instructions after upgrading)
    Transparent Edges
    New compact UI when toggling property creator


    --- Forum chat -------------------------------------------------------
    Hi everyone,
    I'm an artist and I have been learning programming as of late and while working in unity projects I kept writing simple shaders all the time to cover many uses. I got fed up and wanted to write a catch all UI that can toggle through shaders and thats what this tool is, hope you like it.

    I know some of you have been using UNOshader and we've chatted through email, you have helped me make this a more polished tool and I just wanted to express a thank you! and I hope we can use this section for more of that.

    Also if you don't mind I would love to see screenshots of some of the stuff you guys are doing with it. I will be putting up my site soon and I wanted to created a gallery of users using UNOShader :)

    Please use this space for bugs, report any problems or features you would like to see in the future.

    Cheers
     
  2. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Yeaah. Bookmarked. :cool:
     
  3. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    341
    Purchased. Is there any docs for your shaders, or any plans to make one in future? Btw, can I use one Material to control different Emission parts, like give different Emission colors to different Parts of the body, within 1 single Material, to save drawcalls?
     
  4. kriket

    kriket

    Joined:
    Aug 28, 2014
    Posts:
    33
    yeah, i m not buying yet cos read in reviews theres no docs. Pls add some and make the website work pls.
     
  5. toto2003

    toto2003

    Joined:
    Sep 22, 2010
    Posts:
    528
    i really like this shader as it save performance, it work fine on ois so far but got few graphic bug on windowsphone. could u investigate that issue?
     
  6. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Hi everyone sorry for being absent last month was pretty crazy with work and normal life stuff. Sorry if my responses are super late but here they are for others that might be interested, and more some updates as well.

    Site and doc is up and running, LIT version is getting close to being done I will create another thread for it soon.

    For docs go here http://www.unoverse.com/unoshader link from inside UNOShader should work as well.
    No you can not control individual colors independently, but your texture can have what ever colors you want and you can use the Alpha channel of the texture to determine transparency.
    If you are looking for a shader that has the ability to control independent emission colors in combination with other textures textures let me know, I don't think it would be that hard to write one real quick for you.

    When you get a chance could you send me some screenshots of the errors you are getting so i can look into it, thanks much :) I don't have a windows phone to test my stuff.
     
    ikemen_blueD likes this.
  7. GyeongNamStyle

    GyeongNamStyle

    Joined:
    Oct 28, 2012
    Posts:
    2
    Modify Source Code Plz.

    public void getRenderQueue()
    {
    //queueLast3 = currentMat.renderQueue % 1000;
    queueLast3 = queueLast3 % 1000;
    }
     
  8. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Hey,
    I use that line to retrieve the current material renderQueue order so I can display it in the UI
    The line adjusted above doesn't call for anything.

    Is the renderQueue messing something up on your end, could you explain this adjustment a little bit, so I can address it properly.
    Thanks =)
     
  9. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    long time no update..is it still supported? Does it work with Unity 5.2?
     
  10. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Hi there, it should work on 5.2 I haven't had any reports of not working, but you are right this plugin is due for an update.
    I have been swamped with regular work but I'm off from work this whole month and this is definitely going to be receiving some love.
     
  11. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    Thats wwesome news...what are the new features you are planning to add in?
     
  12. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    So I have all this new features in and working. Hopefully after i do some testing I will update the store this week.
    New features:

    Added basic lighting support ( I know... I know.. its called UNLIT )

    • In the past you could mix an ambient color ( now you have full Ambient Source Support), you now have access to the Gradient, skybox or single color now.
    • With full ambient source support you now have lightprobe support as well
    • In the past you could mix the directional light color ( now you have a full directional light with fall off)

    BRDF texture ramp lookup so you can do toon like materials.
    • uses the Red Channel as fall off (fake toon effect)
    • uses the Blue Channel to create custom rim outline
    • uses the Alpha Channel to tweak the fall off ramp.. (hard to explain I'll post some samples later)
    Xray Effect
    • You can use it to display silhouette behind objects, You can choose a color and transparency amount
    Improved the UI
    • Sliders now have box values at end where you can punch numbers
    • Using the new compact texture picker that the standard shader uses
    • UVs sections are now collapsed to save space ( can be expanded )
    Shaders are now smarter ( no need to keep hitting the "Create Shader" button)
    • On the past when you toggled shadows you had to create a new shader, now they are just toggles that are built in the shader
    • Areas that dont' have a checkbox can be altered and toggled around without having to create a new shader

    Miscellaneous

    • Outlines now support 2d cameras (choose from perspective or orthographic)
    • Reflections are now pbr centric so they behave just like the standard shader and also respect what ever is set on the Lighting Window
    • Reflections also respect probe reflections if present ( there is a limitation with shader model 2.0 that I'm still messing with)
    • New metallic slider in Reflections
    • Rim now has intensity so you can do glowing effects with it
    There are other stuff but in general is more of a workflow improvement, but the toon ramp and lighting seem to really give you more options regarding effects now, I'll post some actual materials from scene soon.
    • unoshader unlit 1.32 updates.png
     
    idurvesh and hamyshank like this.
  13. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    Wow that's loads of features..Just last question before buy, how much performance cost with this shaders? Have you done any benchmark? Something like Unity's Mobile Unlit vs Your Unlit with shadows etc
     
    Last edited: Dec 11, 2015
  14. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
  15. hamyshank

    hamyshank

    Joined:
    Jan 31, 2013
    Posts:
    88
    Well looks like we have an update. This is a very good asset. :)
     
    Last edited: Dec 23, 2015
  16. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    hi guys,
    Sorry I did do an update, I just haven't updated the Doc file on the main website yet. Holidays got me preoccupied.
    I may have to do a quick update patch soon though. The new reflection update is more compatible with Unity 5 stuff and it respects HDR stuff, but the trade off is that the fake reflection intensity I had before looked nice (fake but nice). So I'm looking into that at the moment to see if I can add a intensity slider back on.

    Idurvesh,
    Sorry I have not done an intensive benchmark test comparing Unity's unlit vs unoshader unlit, I've done only something very light. I don't have many devices but to answer some of your question, I tried this on an HTC M8.

    32 models 60k triangles each (diffuse, unlit, lightmap support) = 1,9 million triangles
    Unity unlit - 39 fps
    Unoshader unlit - 41 fps

    unoshader unlit with Shadows drop to 17fps

    It is probably not efficient to have 32 objects casting shadows, I'm assuming a more realistic scenario is to have your character only cast shadows and some objects around the scene receiving it. I'll do more performance tests when I get a window of time.
     
    Last edited: Dec 23, 2015
    idurvesh likes this.
  17. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    Boom looks promising.......thanks for sharing benchmark...Was looking for Unlit with shadow though we opt for lightmap for performance....We will soon buy it once our need arrive for Xray and other promising features like Rim,decal ......great job buddy...plz keep updating asset frequently ..
     
  18. mushdevstudio

    mushdevstudio

    Joined:
    May 9, 2014
    Posts:
    37
    Truly awesome! Great work.
    What is the configuration for the absolute fastest mobile shader - all options unticked?
    Is there a way to automatically change all my materials with this shader in one go?
     
  19. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    You can do that easily by following code,

    Code (CSharp):
    1. Public Material myUNOMaterial
    2.  
    3. [ContextMenuItem("Add Uno Materials"]
    4. void AddUno(){
    5.  
    6.        GameObject[] allMaterials= FindObjectsOfType(typeof(Renderer)) as GameObject[];
    7.  
    8.  
    9. foreach(GameObject t in allMaterials){
    10.  
    11. t.GetComponenet<Render>().material = myUNOMaterial;
    12.  
    13. PrefabUtility.ReplacePrefab(t, PrefabUtility.GetPrefabParent(t), ReplacePrefabOptions.ConnectToPrefab);
    14.  
    15. }
    16.  
    17. }
    Drag all gameobjects into scene
    >add above code script to Main Camera
    > add desire UNO material to the "myUNOMaterial"
    >From Context menu (besides help icon) click "Add Uno Materials"

    PS : Code is not tested so check with single prefab.

    ***EDIT**
    Edited code
     
    Last edited: Jan 6, 2016
  20. mushdevstudio

    mushdevstudio

    Joined:
    May 9, 2014
    Posts:
    37
    Thanks idurvesh - you are a great help.
    I have made the SwapShader.cs file and attached to the main camera in scene but can not find SwapShader in the Context menu :(

    I had to modify your script like this to get the compile to work:

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEditor;
    3.  
    4.  
    5. public class SwapShader : MonoBehaviour {
    6.  
    7.     [ContextMenuItem("Add Uno Materials","SwapShader")]
    8.  
    9.     public Material myUNOMaterial;
    10.  
    11.     void AddUno(){
    12.         GameObject[] allMaterials = FindObjectsOfType(typeof(Renderer)) as GameObject[];
    13.         foreach(GameObject t in allMaterials){
    14.             t.GetComponent<Renderer>().material = myUNOMaterial;
    15.             PrefabUtility.ReplacePrefab(t, PrefabUtility.GetPrefabParent(t), ReplacePrefabOptions.ConnectToPrefab);
    16.         }
    17.      }
    18.  
    19. }
     
  21. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    Sorry it should be ContextMenu...


    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEditor;
    3.  
    4.  
    5. public class SwapShader : MonoBehaviour {
    6.  
    7.     public Material myUNOMaterial;
    8.  
    9. [ContextMenu("Add Uno Materials")]
    10.     void AddUno(){
    11.         GameObject[] allMaterials = FindObjectsOfType(typeof(Renderer)) as GameObject[];
    12.         foreach(GameObject t in allMaterials){
    13.             t.GetComponent<Renderer>().material = myUNOMaterial;
    14.             PrefabUtility.ReplacePrefab(t, PrefabUtility.GetPrefabParent(t), ReplacePrefabOptions.ConnectToPrefab);
    15.         }
    16.      }
    17.  
    18. }
     
  22. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Thank you! and yes the one that doesn't have anything should be fastest however your shader will just be black =). But my guess is the one with all off and only vertex colors checked on. and the next fastest probably just color. :p.

    I like what you got going on there idurvesh, I should consider making a utility that allows you to select any shaders from your project and do a replace with UNO like what you've started idurvesh, and may be respect what the user has active on the old material and tick on the correct checkboxes in UNO. hmm....
     
    mushdevstudio and idurvesh like this.
  23. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    Glad I can able to contribute to such amazing asset....Keep updating, waiting for UNO Water asset...When its coming out? will it going to have flowmaps?
     
  24. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    232
    Looks like a great shader! Just a question about fog.

    From your docs >>
    Enables/Disables fog support (no fog saves on math process)

    Is it possible to have the fog calculated in vertex mode? Is is possible to set the fog color? Ive written my own shader to do this, but Id be interested in purchasing your shader if it could do this as well.

    Thanks!
     
  25. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    It doesnt have the fog being processed at the vertex level, but yeah I can see how that could be a nice little performance boost, i would look into adding that to the next update. May be an option to choose FogType: Vertex,Pixel.

    You can also add your own code into any of the shaders that get created from UNOshader if you know what you are doing with shaders.
     
  26. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Water is taking a back seat at the moment because I've been messing with VR lately. But once I get back on it I will add features like what you are describing
     
    idurvesh likes this.
  27. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    232
    Thanks for the quick reply @RodneyO !

    That's great, please keep me posted when this makes it into an update.

    Thanks again!
     
  28. sathya

    sathya

    Joined:
    Jul 30, 2012
    Posts:
    297
    Hi,
    Is it possible to create billboard shader with this ? want to create billboard shader for trees.
     
    mushdevstudio likes this.
  29. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    No I don't have a bilboard setting on the shader. I did a search and there seems to be some stuff out there for bilboard, is there a specific combo with UNOshader you are hoping to have on the bilboard I might be able to write you something if I get a window of time.
     
  30. sathya

    sathya

    Joined:
    Jul 30, 2012
    Posts:
    297
    Yea Want to have an unlit billboard shader which receives shadow. Hope thats achievable and practical.
     
    mushdevstudio likes this.
  31. Fabioisriva

    Fabioisriva

    Joined:
    Feb 3, 2016
    Posts:
    15
    Guys any idea how to make UV rotating in clockwise?
     
  32. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Just put a negative number on the rotation slot like -25 or so
    cheers
     
  33. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    I think what he means is rotate uv like how clock works....Something like what we see in uGUI's Image's "Image Type == Filled"
     
  34. DavidSmit

    DavidSmit

    Joined:
    Apr 1, 2014
    Posts:
    50
    -Edit:
    Never mind, if I turn on color it does show. :)

    Hi, I just bought the shader pack, but somehow as soon as I turn on the Transparent render mode, the whole model just disappears. No matter what I do on the sliders it doesn't show.
    A bug? Or am I missing something (V1.41)
     
  35. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Cool =)
     
  36. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Hi guys, I'm about to roll out a new update in the next few days. Stuff in red is going up the rest I'm looking into.

    Fresnel / Rim Scale issues.

    I can't believe I submitted a shader version without checking scale on objects. I was using local object math so the fresnel, rim or anything was falling apart if the objects were larger then 1,1,1 . This is now fixed.

    Multi material support
    I fixed the ability to edit multiple material properties like textures, colors, etc. this now works. But I'm running into a little hiccup at the moment, UNOshader toggles between different shaders so I have to write some new stuff to track multiple types of shaders when you have multiple materials selected, since you can possible have variety of combinations of shaders or a potential shader that doesn't exist I need enable a create button... blah blah.. I'm getting close to figuring this out if not I will submit this part on a future update

    Xray updates
    I had a couple of request with wanting different looks on the Xray rather then just a solid silhouette color. I'm going to add a couple of other option effects for the xray one that looks transparent with fresnel rim, etc.

    Matcap
    Matcap like texture was also requested I will look into this for future update.

    Normal maps
    Since UNLIT now supports some basic lighting I have had requests for this feature, Shader model 2.0 is very limiting on the math, right now you can turn everything on and I capped the processing, If I add normal map support I go over the calculations allowed by SM2. which means I need to track calculations happening and warn you you are going over and not let you create a shader because it will be pink... but I'm looking for solutions for this right now, I might add a SM3 checkbox and you can go over the limit or I might just have to roll out the LIT version as I have it right now which is build under SM3 as a base.

    If you have any requests please let me know. When i get chance I will start creating youtube tutorials showing tricks you can do with UNOshader.

    cheers,
     
    Last edited: Mar 3, 2016
  37. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Version 1.5 has been submitted. Unity usually takes about 3-7 days after submission.

    Update Notes.
    - Fixed 1,1,1 scale issues
    - Added multi material support when you select from project
    - Added new Xray options
     
  38. locus84

    locus84

    Joined:
    Mar 30, 2011
    Posts:
    119
    Xray shader
    o.uv = fixed4(0, 0, 0, 0);
    is missing.
    there's an exception which indicates some of vars not completely initialized in v2f
     
  39. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Thanks locus for reporting this =)

    It is now fixed for the next update, but if you are tired of seeing the error until the next update you can:

    1. download the fix here:
    http://www.unoverse.com/unoshader/fixes/xray.zip
    and replace the files inside your "assets/UNOShader/Bin/Shaders"

    or

    2. Open up the "Assets/UNOShader/Bin/Shaders/UNOShader_Helpers_Xray.shader" file and remove the line of code
    fixed4 uv : TEXCOORD0;
     
  40. agito1987

    agito1987

    Joined:
    Mar 13, 2013
    Posts:
    27
    Hi
    Question regarding the shadow option.
    When I use shadows my flat surfaces get vertical lines. Is there a way around this?
    Capture.PNG
     
  41. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    that looks really nice! Have you tried messing with the bias and normal options on the directional light. Try that to see if that helps
     
  42. Steven-C

    Steven-C

    Joined:
    Mar 7, 2016
    Posts:
    3
    I recently downloaded UNO Shader, this is really good!

    I applied an alpha Xray shader to my character (who is composed with only one complex mesh),
    but I would like to remove the superposition of the alpha.

    I would like to know if it is possible to have an uniform alpha for the Xray?

    UNO_XRAY_ALPHA.PNG
     
  43. agito1987

    agito1987

    Joined:
    Mar 13, 2013
    Posts:
    27
    Tried, but didn't help. The shadow acne wont go away.
    When I go trough the values of the bias I get to the point that I get floating shadows. And the normal bias option doesn't do anything on the Unomaterial. I also tried the standard unity shader and everything works fine.
    rising the lighting resolution or playing with the cascade values of the shadows doesn't work either.
    Made a new project and scene but the shadow acne stays.
    shader still error.PNG
    Also put the material on a unity cube and sfeer. Cube same issue. On the sphere it is there, but almost not noticeable.
     
  44. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    I will start running tests tonight and tomorrow and try and fix this for you. I will let you know =)
     
    agito1987 likes this.
  45. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Thanks glad you like the shader =)
    Short answer not right now, I tried to make the alpha sorting work before but was uncussesfull =( I read of other potential solutions like post process, but they seemed expensive but I will try another solution in the future.
     
  46. Steven-C

    Steven-C

    Joined:
    Mar 7, 2016
    Posts:
    3
    Ok, thanks :)
     
  47. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    I think I found it, can you give this a try.
    Replace the files inside your "Assets/UNOshader/Bin/Shaders" Directory with the ones from this zip.
     

    Attached Files:

  48. agito1987

    agito1987

    Joined:
    Mar 13, 2013
    Posts:
    27
    Ok the normal bias has now effect on the shader and I can get rid of my stripes!
    But now the dark main shadows have a strong flicker and are not as smooth, but rather harsh and edgy. (dialing up the normal bias makes this effect worse)
    I hate to ask but could you have one more look at my new problem?
    Thank you for looking in to my problem so fare. Really appreciate it.
    ErrorTest_02.PNG
    edit(1)
    Btw when rotating the cubes in the exempel scene this problem is also visible. Shadow works great in certain angel but falls apart when it is in motion or in an angel that is not ideal.
    edit(2)
    Ok dont know if this is supposed to happen but if you rotate the light in the Z axes the noise variation and the scale of the artifacts changes.
     
    Last edited: Mar 11, 2016
  49. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Ya I will keep at it =) and update you
     
  50. Elzean

    Elzean

    Joined:
    Nov 25, 2011
    Posts:
    584
    Hi!

    i would like to know if there is a way to make the box projection from reflection probes work with UNOShader ?