Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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
    Hi, UNOShader should respect the probes and use them as you walk into them. You can also change the reflection to custom and load your probe baked exr file into it manually. Is that what you meant?
     
    Last edited: Mar 15, 2016
  2. Elzean

    Elzean

    Joined:
    Nov 25, 2011
    Posts:
    584
    So here is the standard shader without the box projection, the option is within the probe:



    and with it:


    With unoshader it always like the first pic, and it looks a lot better with the option especially while moving in the level its completly different (hard to show with pic)


    Here is the explaination from unity:



    I pushed the reflection so its easy to see, hope that help!
    Let me know if this is something i can do already or if it's easy for you to add ?
     
  3. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Ah yes ! I remember using that before great for flat walls, It seems like I should be able to implement that, probably some math needed to be added somewhere. I'm out to GDC all week this week but I will start updating the shaders after I get back. Thanks for the samples. =)
     
  4. Elzean

    Elzean

    Joined:
    Nov 25, 2011
    Posts:
    584
    Thanks! let me know when you add this :)
     
  5. ncho

    ncho

    Joined:
    Feb 1, 2014
    Posts:
    99
    Hi, was wondering if it was possible to include the demo scene in the asset as I am not too experienced with shaders and materials and would like to find out how certain things were done.
     
  6. Elzean

    Elzean

    Joined:
    Nov 25, 2011
    Posts:
    584
    Hey was wondering if you had the chance to have a look at the reflections ?
     
  7. Itanotomomi

    Itanotomomi

    Joined:
    Mar 30, 2016
    Posts:
    1
    How to edit brdf texture in unoshader
     
  8. agito1987

    agito1987

    Joined:
    Mar 13, 2013
    Posts:
    27
    Hey Rodney. Wanted to check in if there is anything new? Haven't heard of you in awhile.
     
  9. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Demo scene is included, you can see in there how those shaders are being used.
    I'm trying to get another shader released this month is one of the new thing, and I need to update Elzean with projection type reflection support.

    Hey Elzean, sorry for the lack of response, I have been super busy all of last month with regular work stuff. But I'm going to be doing this update soon I hope.
     
  10. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    BRDF_Shading.jpg
     
  11. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Version 1.6 submitted to asset store
    - Fixed console errors (editorguilayout)
    - Box projection support for reflection probes
    - Improved UX when using BRDF
    - When using lightmaps, Rim doesn't overpower lightmaps luminance
    - Removed a multiplier I had in emission when baking ( you may have to adjust your settings if you are baking using emission)
     
    Elzean likes this.
  12. wouter_vugt

    wouter_vugt

    Joined:
    Feb 25, 2015
    Posts:
    128
    Hi Rodney,

    Is there a way to tween the color value by script?
    I tried to acces it the normal way (mat.color) but nothing happens.
     
  13. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50

    GetComponent<Renderer>().sharedMaterial.SetColor("propertyName", "RGBColor");

    There is also a sample in the UNLIT/scripts folder, called ColorPropertyChange.cs
     
  14. KaOzz

    KaOzz

    Joined:
    Oct 15, 2012
    Posts:
    82
    Hi! Is there any way to get this shaders to be affected by one light (a spotlight for example) at per-pixel level?
     
  15. LMan

    LMan

    Joined:
    Jun 1, 2013
    Posts:
    493
    I'd like to do something similar to what LOZ windwaker did with their lighting, where the light source that shades a character is determined by distance.

    I figured I would get the distance to a light source, (ie. A torch) and rotate the source light to match the vector and set intensity/color accordingly.

    My difficulty is that changing the angle of the source light also changes all the realtime shadows for the level geometry. If I light the character independent of the rest of the level, I lose his realtime shadows on the level geometry.

    Have any ideas for me?

    If I had a way to pick which directional light was used as the source light, or have an option to set the angle and intensity of the shading/shadow without a light at all, I could light any material from whichever direction I wanted.
     
    Last edited: May 20, 2016
    agito1987 likes this.
  16. SwiftIllusion

    SwiftIllusion

    Joined:
    Jan 22, 2012
    Posts:
    66
    I'd like to ask, is there any way to edit the properties of these shaders as a material instance? Searching google I found materials are supposed to automatically generate an instance once a property is changed unless it is defined as shared, however I couldn't find shared within your shaders so I can't understand why it is affecting every object instantiated object that has that material, unless there's some additional step required?
    In my case I'm using the material "UNOShader/_Library/UNLIT/UNOShaderUNLIT Color Diffuse "
    Would really appreciate an answer as I love your materials so would hate to not be able to use them for such a small reason.
     
  17. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Sorry no, currently the shader only supports directional lights and probe lights.
     
  18. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    I may look in the future into adding support for this, right now you are correct that the materials/objects use the one directional light. I've been out of the country and in vacation so I apologise for the super late reply.

    To make this happen I can try and specify a fake position of the light inside the material, but there is going to be a need for some experimenting that needs to happen to make this work. Email me and I might be able to make something custom for your case.
    rodney@unoverse.com
     
  19. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Hi there, I need to read on how the automatic instancing inside of unity of works but I do know that you can use different commands inside your code that do just that, for example.

    1. You have Material "A" and you have gameobjects 1,2,3 that use that material and through script you use:
    renderer.sharedMaterial will affect material "A" and therefore all game objects (1,2,3) will look the same.

    2. The minute you use renderer.material in code and that script is affecting... lets say gameobject "1" you will now create an instance of Material "A" and gameobject "1" will now have a unique material and gameobject "2,3" will still be using the material "A"

    I hope that was what you were asking for and I understood your question.
    cheers,
     
    SwiftIllusion likes this.
  20. SwiftIllusion

    SwiftIllusion

    Joined:
    Jan 22, 2012
    Posts:
    66
    @RodneyO Thanks a lot! That was just what I needed to get it working, really appreciate it :)!
    And thanks in general for a really awesome plugin, great work with this!
     
  21. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Your welcome =) and thank you as well
     
    SwiftIllusion likes this.
  22. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    @RodneyO
    Hi,
    Your plugins works with Shader model 2 , but Unity roadmap states OpengGL2 for windows will be removed. How does this affects your plugin ?
    Because i could be interested for a game to switch to unlit shaders.
     
    2dgame likes this.
  23. lucasabritta

    lucasabritta

    Joined:
    Jul 5, 2016
    Posts:
    1
    Hey man, i'm trying to change the render of the material by code, change from Opaque to transparent. How can i do this?
    i see around and the guys use somethink like this:
    material.SetFloat("_Mode", 1);
    but it isn't work for me, have any way to do this?
     
  24. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Hi Lucas, I do not use that shader feature in my shaders, I probably should considering setting that on my shaders in future updates. If I'm not mistaking that is the what the standard shader of unity uses.

    Right now if you want to change it you have to swap shaders
    https://docs.unity3d.com/ScriptReference/Material-shader.html

    Now that I think about it the transparent "_Mode",1 that you are talking might not be as ez with UNOshader let me read on it and get back to you.
     
  25. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    I dont think it would do much, haven't really read up on it to be honest. Unity creates the OpenGL2 stuff when it packs the shaders, I'm just going to assume that those will just be removed by unity when unity compiles shaders
     
  26. VOTRUBEC

    VOTRUBEC

    Joined:
    Dec 17, 2014
    Posts:
    106
    Hi RodneyO,

    Got a problem. Using 5.5b7, and the editor component returns an error:

    MethodAccessException: Method `UnityEditor.EditorUtility:SetSelectedWireframeHidden (UnityEngine.Renderer,bool)' is inaccessible from method `UNOShader_UNLIT:OnGUI (UnityEditor.MaterialEditor,UnityEditor.MaterialProperty[])'

    Any chance you could take a look at this for us? It might be a breaking change introduced in Unity 5.5? I'd have taken a look at it myself, but the editor has been compiled into the DLL.

    Thanks.
     
  27. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    I haven't been working on the beta, I know that is the button I use for wireframe mode, I will check it out when I get a chance and let you know.
     
    VOTRUBEC likes this.
  28. GrooGadgets

    GrooGadgets

    Joined:
    Apr 2, 2009
    Posts:
    71
    Hey Rodney,

    First up I have to say I just love your shader! I'm using it in my mobile game and it looks fantastic.

    Now I have an issue when deploying to Android. When I use the Reflection option I select custom and choose the cubemap I want from my project. In the editor and iOS it displays perfectly but on Android it seems to ignore the custom cubemap and uses the skybox defined in the lighting tab.

    Is this a bug or is there something I need to do to get this working properly on Android?

    Cheers,

    Simon
     
  29. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    353
    I bought this a while ago but couldn't really figure out how to use these shaders in my project. I currently use mobile diffuse shader mostly and on some objects legacy/reflective shader.

    When I tried the unlit, it looks like these shaders don't support lightmaps. Is it right or do I miss something?

    Documentation shows a toggle on the left of the Lightmap section of shaders but I can't see it on my project.
     
  30. Cato_xyz

    Cato_xyz

    Joined:
    May 18, 2013
    Posts:
    60
    Hey Rodney,

    I've been experiencing some distortion on textures for some mobile devices, but not all.

    The settings activated on the shader are just Diffuse, Color and Vertex colors

    Tho this problem is not present on PC, i don't know which might cause it;
    UV maps has been checked and textures are set to tiling.

    I attach some screenshots of how it looks.
    Incorrect_textures.png Correct_textures.jpg


    Any help would be appreciated.

    Best regards,
    Carlos TM
     
  31. aglitchman

    aglitchman

    Joined:
    Sep 24, 2014
    Posts:
    2
    Hello!
    Could you please upgrade your package for Unity 5.5? It's not compatible.
     
  32. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Sorry guys, have been gone for a while and not have had the time to update the shader.
    Things that I will be looking at this month.
    - Unity 5.5 compatiblity
    - VR optimizations
    - Shaderkeywords optimizations
    - Reflections on different platforms (ios, android, etc)
    - Lighting or gamma on android, I've had reports of android brightness looking different
    Zertrax, im going to be investigating your issue sorry for the delay

    cheers,
     
  33. BigBite

    BigBite

    Joined:
    Feb 20, 2013
    Posts:
    108
    I don't know if you have seen the Guilty Gear xrd GDC presentation, but I was wondering if one could get that look using this shader? Some of the key features are:
    • Variable outline thickness (camera distance and/or possible vertex info)
      • A possibility to blend between the two
    • Custom color for light and dark areas (I think you shader already does this)
      • Possibly through texture lookups
    • Use information stored in vertex info to "add" more shadow
      • Example: AO baked into vertex info gets turned into a shadow that gets appended to the "normal" shadow
    • Ability to have some areas always in shadow (prob through vertex info)
    • The possibility to rotate the Rim texture ramp based on light vector
      • Ability to fade out this texture at will (maybe even based on light intensity or slider)
    • Ability to fade between ramp lighting and "normal" toon lighting. (in case it has to be one or the other)
    I would like a shader that has those features working in tandem (not sure if it's possible). I'm actually not that concerned with performance that much (like at all). This would not be for a game.

    Video for refrence:
     
    Last edited: Dec 24, 2016
  34. rtritean

    rtritean

    Joined:
    Nov 30, 2013
    Posts:
    4
    Hello!

    We have an issue with uno when lighmapping. The uno shader has a really darker look and higher contrast when compared to a default shader.
    Check out the comparison between Uno Unlit and Mobile Unlit (Suports Lightmapping) in the attached picture. Directional light is turned off, all lighting toggles are OFF for uno, and we are using the same baked lightmaps. Just changing the shader. As you can see there is a huge difference and we can't get it to look properly even if we increase the light intensity (it will look blotched).

    Is this a known issue?

    Looking forward to your answer.

    Happy Holidays!
     

    Attached Files:

  35. 2Elemental

    2Elemental

    Joined:
    Jul 17, 2013
    Posts:
    12
    Hi Rodney,

    I was wondering if you could extend the shaders to support the stencil buffer,or that you could outline how to do this myself? I've also sent you a support email regarding this. Thanks for your feedback.
     
  36. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    I've looked at the thread extensively and I love it. UNOshader has a very basic implementation. I have contemplated on creating a super toon shader like the one in guilty gear time has just been my enemy. But who knows may be at some point i'll jump on it and I agree with you setting no limits on performance would be very to work with.
     
  37. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    This was a line of code I left by accident long ago, my bad , this has been fixed and will be out on the new update.
     
  38. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Hi there,
    I've never done stencils, but from reading about it I would have to write some sort of framework that could support it with UNOshader UI. (sounds a bit complicated at the moment for the UI level) , but it sounds like something that can be added through code at a per shader case.
    I haven't done any tests my self but you will have to remove this line from any UNOshader that you want to edit.

    CustomEditor "UNOShader_UNLIT"

    and then add features listed from this link
    https://docs.unity3d.com/Manual/SL-Stencil.html

    I will also try and get familiar with it.
    cheers,
     
  39. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    353
    Hi, I think you missed my e-mail and comment. I need to learn if using brdf in your shader will give meany disadvantage in terms of performance. Without using BRDF, it looks darker than usual unity shaders.
     
  40. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    BRDF texture lookup is extra math processes but texture lookup can be a tiny bit more expensive in process. When you say darker in BRDF it uses a texture for shading so the texture gradient is what controls the shading at that point. I tried to add a slider to increase the ambience which is in essence is making the BRDF texture brighter.

    The Docs haven't been updated for a bit regarding the lightmap checkbox, it is now automatic just like any unity shader. Set your gameobjects to static and bake your lightmaps and the lightmaps will show up after baking.
    (There is a bug I'm fixing regarding lightmaps looking darker, that should up on the next update).
     
    hakankaraduman likes this.
  41. GrooGadgets

    GrooGadgets

    Joined:
    Apr 2, 2009
    Posts:
    71
    Hey Rodney,

    Just wondering if UNOShader works for iOS Metal. I've used it throughout my game and it seems to be throwing warnings in Xcode that it's not compatible.
     
  42. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    HI,

    I got problems with lightmaps when upgraded to 5.5 and new uno shder from a store. 1.61.
    Lightmaps looks very dark in a editor and very bright on android devices. when changed shader to standard unity problem disappeared.
     
  43. MinhDao

    MinhDao

    Joined:
    Oct 28, 2013
    Posts:
    155
    Any new on this? I'm waiting for lightmapping fix!
     
  44. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Hi everyone,
    Sorry for the lack of updates, with GDC around the corner I haven't had the time to dedicate it to the shader.

    ---- Update -------
    I'm submitting an update in the next couple of days, (usually takes the unity team about 5 days to approve it)
    - Fixed the lightmap issues ( I had to redo the way the math was being done completely)
    - Added support for dynamic lightmap support as well
    - Workflow behaves closer to unity lighting colors and system so it might be a bit different the older unoshader versions
     
  45. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    Thanks, RodneyO refreshing asset store everyday for update.
     
    RodneyO likes this.
  46. AngelusDarkness

    AngelusDarkness

    Joined:
    Jul 8, 2015
    Posts:
    5
    Hi Rodney! first of all! i want to thank you for this great set of shaders!

    Sadly i'm having issues with Unity 5.5 and UNOShader, basically differences on how the shaders looks in Editor and SamsungS6 GearVR.

    Here i added some examples. We do our light-mapping on Blender and not use any lighting of Unity.

    I hope you can suggest us something to do.

    Best Regards!
    Pablo
     

    Attached Files:

  47. MinhDao

    MinhDao

    Joined:
    Oct 28, 2013
    Posts:
    155
    Hi Rodney! Thank for update version!

    But I'm having issues with new workflow behaves. Models use new shader look different and darker than older version. It broke my current project. Could I have lightmap fix version without new workflow behaves?

    Thank you!
     
  48. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    I decode lightmaps using unitys decode command line which to my understanding supports full HDR(exr)?Check to see if blender has an option for exr format or HDR enabling at render time when you bake your lightmaps.

    If not I think the way some the math works for decoding lightmaps is that it takes the RGB channel of the image and multiplies with the alpha channel to figure out how intense lightmap will look.
    I think we just need to grey out the alpha to some value to match what you have in blender.

    Hope that makes sense.

    If it doesn't we might need to edit the code inside the shaders for decoding a plain lightmap without HDR support.
     
    Last edited: Feb 14, 2017
  49. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Hi =),
    Yeah Im sure we can work something out with a version that is unique for you, out of curiosity is it mainly lightmaps that look darker? or is the shader now looking darker? I hope is the lightmaps cuz the fix was to make sure that the lightmaps look just like the Unity standard lightmap.
    send me and email and I can send you a version, give me a little bit since the new version's math is really different the old one.
    thanks
     
  50. RodneyO

    RodneyO

    Joined:
    Jan 22, 2011
    Posts:
    50
    Sorry dude I just read your question properly my bad. The issue isn't the decoding in general is the way it looks on Gear VR got you, I just got my s7 and I will test that in VR mode.

    So I ran some tests...
    So I guess i set all of my projects "color space" to linear when I deploy to android and all comes across corectly, when ever I have the color space set to gamma, lightmaps get all brighter. I read this somewhere before and these are the settings I use for my stuff.

    Go to Player settings:
    - Other settings
    Color Space = linear
    Uncheck Auto graphics API (Remove OpenGLES2) (fixes some other stuff , cant member what exactly, I think it was shadows or some like that)
    Minimum API level = Android 4.3 Jelly Bean

    let me know if this fixes your issue.

    -Rodney