Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

ShaderGraph/LW how to create a simple lit graph?

Discussion in 'Graphics Experimental Previews' started by demonixis, Oct 29, 2018.

  1. my_little_kafka

    my_little_kafka

    Joined:
    Feb 6, 2014
    Posts:
    92
    I really need this too
     
    retired_unity_saga likes this.
  2. Eclectus

    Eclectus

    Joined:
    Oct 29, 2012
    Posts:
    20
    Bump! This would be useful :)
     
    retired_unity_saga likes this.
  3. Bip901

    Bip901

    Joined:
    May 18, 2017
    Posts:
    71
    Has the status changed yet?
     
    retired_unity_saga likes this.
  4. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    317
    Bump, sounds pretty essential.
     
  5. Ziplock9000

    Ziplock9000

    Joined:
    Jan 26, 2016
    Posts:
    360
    I need to make a version of URP/Simple Lit that allows for colour replacement. You're telling me after 2 years you can't create and edit it in the shader graph? wow.
     
    Last edited: Dec 22, 2020
    retired_unity_saga likes this.
  6. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    761
    Adding to the +1 that I also need it. Seems like Unity just doesn't want to add it for some reason. They've had plenty of time to do so by now.
     
  7. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    229
  8. yasirkula

    yasirkula

    Joined:
    Aug 1, 2011
    Posts:
    2,901
    Hi all. On Unity's Shader Graph roadmap, you can click Submit a new idea! to forward this suggestion to Unity team. They may not be reading the forum threads so I guess there is a better chance there.
     
    n-gist likes this.
  9. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    229
    Hi, we need a very fast shader for VR. With the best possible visual result. Let me try one oldschool trick:
    One of the fastest shaders should be Unlit created with Shader Graph.
    upload_2021-3-25_7-29-37.png
    But the quality is just unlit. On the left is the default URP Lit material:
    upload_2021-3-25_7-35-27.png
    We can setup light and spheres for light baking- and multiply color (or texture) with Baked GI node:
    upload_2021-3-25_7-39-29.png
    Light is in "Baked" Mode, both object "Lightmap Static":
    upload_2021-3-25_7-43-29.png
    Better. Now I will add more information about the light from the surroundings - I will take this information from the reflection probe:
    upload_2021-3-25_7-51-45.png
     
  10. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    229
    Object on left is "Reflection Probe Static", reflection probe is in middle of the right sphere:
    upload_2021-3-25_7-58-1.png
    I can use the LOD level from the reflection probe to change the "smoothness":
    upload_2021-3-25_8-1-19.png
    upload_2021-3-25_8-3-52.png
    upload_2021-3-25_8-5-41.png
     
    Last edited: Mar 25, 2021
  11. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    229
    I am convinced that such a shader can be tuned to work for static objects.
    BUT
    I'm not a good enough programmer to know how to set the View Vector and Normal parameters in the Reflection probe node correctly.
    Because now the texture from the reflection probe rotates at the same time as the object, and if I import an object from CAD software where the Z axis is upwards, it is rotated 90 degrees ...:oops:
    upload_2021-3-25_8-18-54.png

    I'm trying to open a discussion, the essence of this trick (image-based lighting combined with baked shadows) worked well for me in unity 3.x, 4.x.

    Edit: View Direction- World and Normal Vector- World nodes added, recombined:
    upload_2021-3-25_17-20-28.png
    upload_2021-3-25_17-21-18.png
    Standart baked URP Lit material left, "unlit" test right.
    :)
     

    Attached Files:

    Last edited: Mar 25, 2021
    DanjelRicci likes this.
  12. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    229
    Shader file:
     

    Attached Files:

    Ziplock9000 likes this.
  13. Perkovic15

    Perkovic15

    Joined:
    Jul 30, 2021
    Posts:
    9
    Its 2022 and we still haven't got simple lit shader graph
     
  14. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    How long is that damn backlog
     
    retired_unity_saga likes this.
  15. tiptoe

    tiptoe

    Joined:
    Jul 8, 2013
    Posts:
    1
    +1 Seems like a simple thing. Why it is taking so long? Or is there some other preffered way how to create mobile friendly shaders except for starting with Unlit and creating custom lighting?
     
    retired_unity_saga likes this.
  16. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    137
    Who knows. They are not at all transparent about this. I find it a complete joke that they don't even support their own base Uber shaders in Shader Graph. Custom lighting results always look different when compared to their SimpleLit shader, and it really isn't feasible to use SimpleLit as-is throughout your whole game. So you either get inconsistent visuals, or only use your own custom lighting, which makes the Uber shaders useless.

    Meanwhile Unity is on to Advance Quantum Physics without having completed Math101 first... Backwards. And honestly feels like a slap in the face to their mobile devs.
     
  17. IgorBoyko

    IgorBoyko

    Joined:
    Sep 28, 2020
    Posts:
    90
    Bump, very useful for mobile.
     
  18. Deleted User

    Deleted User

    Guest

    Plz any ETA for this???
     
    retired_unity_saga likes this.
  19. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,137
    @phil_lira @izym @peterbay Can I get simple lit shader graph feature anytime soon? I really need this feature for mobile platform.
     
  20. Zallist

    Zallist

    Joined:
    Dec 4, 2020
    Posts:
    3
    I needed the Simple Lit target, and came across this thread. And found that nobody had just made the relevant UniversalSimpleLitSubTarget, which isn't really that much effort for the current version of URP (2022.1+, at least). So I've went and done just that and released it under an MIT license on Github for everyone to use:

    https://github.com/Zallist/unity-universal-shadergraph-extensions

    And it just does what Unity should do, in exposing a Simple Lit material to the Universal target in Shader Graph:

    upload_2022-5-8_20-56-58.png

    Feedback welcome. Or not, you can just take it.

    The code is basically just the Lit MasterNode, stripped down to what it needs just for Simple Lit and the logic necessary to call Blinn Phong.

    It does NOT work for Deferred Rendering right now since I have no need for that. Or VFX Graph.
     
  21. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    137
    We both completed our own versions of this the same day, but since you already posted to github, I've decided to merge mine with yours, URP 12 support already done now (for those that need it). Next I'm working on deferred support being merged, then possibly a BakedLit node (I'm not as interested in doing the VFX stuff though), IMO this would finally make Shader Graph complete.

    Thanks so much for your work on this Zallist!

    I hope Unity merges this code directly, as Zallist has been careful to make it easy for them to do so. And, correct me if I am wrong, but I think Zallist actually would like for Unity to merge this.

    So if anyone from Unity sees this, the work has been done for you.
     
  22. Zallist

    Zallist

    Joined:
    Dec 4, 2020
    Posts:
    3
    upload_2022-5-11_9-50-13.png

    If raising an Issue against the repo asking Unity to just take the code wasn't a clear enough request for them to adopt it, I don't know what is.
     
  23. Deleted User

    Deleted User

    Guest

    Can I know whats taking soo much time to implement such simple feature!!! I just don't understand?? It's almost 4 years now!!! Why such important feature for mobile games is in backlog for soo long!!??? We got barely anything in 2022.1 for URP, you guys might be working hard but the development feels very slow when compared to HDRP!!!
     
  24. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    137
    Hi EagleG,

    Please checkout Zallist's github code, which is now complete for SimpleLit (Forward and Deferred) and VFX support. At this point, he is just waiting for Unity to take the code and run.
     
    Deleted User likes this.
  25. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    137
    Haha

    Yes I knew this, but I didn't want to come off as though I was speaking for you.
    :)

    Thanks again for taking this on, Zallist. Much appreciated!
     
  26. Game-Armada

    Game-Armada

    Joined:
    Apr 29, 2013
    Posts:
    66
    ping
     
    FixItFelix likes this.
  27. vTimePawel

    vTimePawel

    Joined:
    Aug 1, 2017
    Posts:
    32
    bump, this seems like a simple addition and works well.
     
    retired_unity_saga likes this.
  28. XenotechSrl

    XenotechSrl

    Joined:
    Dec 2, 2020
    Posts:
    5
    Zallist, thank you so much for your effort, works like a charm.
    Unity, you just need to pull from Zallist GitHub repo and do NOTHING, what's taking you so long? This is just unacceptable.
     
    retired_unity_saga likes this.
  29. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    137
    Just a note, I've already got all the URP 14 stuff completed, so when I get a min I'll do a pull request. The latest beta notes reference fixes in 2022.2.0f1, so the stable release is just around the corner. The URP 14 graphics repo is stable and hasn't changed for a very long time, so it is pretty unlikely there will be changes between now and the release. Just a heads up for all who are relying on Zallist's repo - support is incoming!

    Edit: Do we have any Alpha/Beta release testers here? Is there any interest in creating Alpha/Beta branches of this? If so, let me know here.
     
    Last edited: Nov 24, 2022
    retired_unity_saga likes this.
  30. camillazi

    camillazi

    Joined:
    Sep 28, 2020
    Posts:
    6
    Any update?
     
    retired_unity_saga likes this.
  31. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    137
    Which version of URP are you looking for, camillazi?
     
  32. rastleks

    rastleks

    Joined:
    Jul 17, 2014
    Posts:
    52
    Thank you Zallist!

    Unity Technologies, please, do it already, really needed and simple feature!
     
  33. Epsilon_Delta

    Epsilon_Delta

    Joined:
    Mar 14, 2018
    Posts:
    261
  34. zenbin3d

    zenbin3d

    Joined:
    Jul 7, 2023
    Posts:
    27
    @phil_lira

    Hey guys, it's not even funny anymore after all these years since ShaderGraph has been released.

    We need a more flexible/modular way of creating our own custom master graph nodes that should allow to easily support, replace or extend Unity rendering features like lightmaps, light probes, additional lights (per pixel or per vertex), object space or tangent-space normals, light layers and so on.

    Having a modular approach to "assembling" master nodes for shader graph out of some extensible core "building blocks" would open a lot of flexibility of allowing at least anyone to be able to create their own version of SimpleLit graph.
     
    retired_unity_saga likes this.
  35. HenryTownshend

    HenryTownshend

    Joined:
    Jun 19, 2017
    Posts:
    14
  36. zenbin3d

    zenbin3d

    Joined:
    Jul 7, 2023
    Posts:
    27
    I have a message from the future:

    2 0 2 5
     
  37. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,532
    Oh no we have been cursed :eek:
     
  38. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,219
  39. zenbin3d

    zenbin3d

    Joined:
    Jul 7, 2023
    Posts:
    27
  40. martinmohr

    martinmohr

    Joined:
    May 11, 2020
    Posts:
    9
    This is kind of mind-blowing, that it's still not there. Might be too idealistic, but I would never have release shadergraph as a product without it covering all traditional shader options and functions. Should be a visual scripting option for ALL shader stuff. Not catering to mobile is truly bizarre.
     
  41. retired_unity_saga

    retired_unity_saga

    Joined:
    Sep 17, 2016
    Posts:
    296