Search Unity

2D Shadergraph & Lighting Question

Discussion in '2D' started by MisterSkitz, Feb 7, 2020.

  1. MisterSkitz

    MisterSkitz

    Joined:
    Sep 2, 2015
    Posts:
    833
    It is my understanding that in order to create a glow effect with 2D shadergraph one must have Universal Render pipeline. In order to use 2D lighting, one must have Lightweight Render Pipeline. Is it okay to use both pipelines? Or is this one of those things where they may conflict if you install/import both?

    Additional information:
    I've never used either of these features but I'm curious enough to start a project just to learn how these things work. I'm using Unity 2013.3 the currently-latest release.

    I would also really appreciate links from your best tutorials on how to get started with 2D lighting. Shadergraph, well I'm good on tutorials for now. My problem only resides with the pipelines. I don't know whether I need both or one of the other. I also appreciate all thorough and solid feedback!

    Thanks for your time, amigos!

    -- Mr. Skitz
     
  2. Tom-Atom

    Tom-Atom

    Joined:
    Jun 29, 2014
    Posts:
    153
    You need only Universal Render Pipeline (URP). It replaced Lightweight Render Pipline (LWRP). Replaced = LWRP was renamed to URP and is further developed under this new name. I can imagine LWRP was not good name from marketing point of view.

    There is also minimal setup when you install URP - almost all recent tutorials show it (we have one on our blog too: http://sbcgames.io/setting-up-unity-lightwave-render-pipeline-lwrp-and-2d-renderer/ - it is for LWRP, but it is the same for URP)
     
  3. MisterSkitz

    MisterSkitz

    Joined:
    Sep 2, 2015
    Posts:
    833
    Oh, I see! That's where my confusion was lol Thanks for that explanation!

    I downloaded LWRP into unity before I even made this post. Should I remove that and import the URP or since it's the same thing does it not really matter? I know, sounds like a blatantly dumb question lol but I'm just trying to understand.

    Edit:

    And that link was very useful! Thanks for that!
     
    Last edited: Feb 7, 2020
  4. MisterSkitz

    MisterSkitz

    Joined:
    Sep 2, 2015
    Posts:
    833
    @Tom-Atom Okay, I was able to answer my own curiosity and solved it. When I imported LWRP it automatically imported URP. That's good to know. Now, I followed your link for the LWRP and got everything set up. However, at the very end, it say's I need to click on the asset

    upload_2020-2-7_12-42-42.png

    I don't see a Renderer Type in my inspector

    upload_2020-2-7_12-44-6.png

    So how do I set the 2D renderer up? Or is it already good?


    Edit:

    Apparently there's a + symbol you can click
    upload_2020-2-7_12-50-53.png

    So I think that's now officially set up, right? lol
     
  5. Tom-Atom

    Tom-Atom

    Joined:
    Jun 29, 2014
    Posts:
    153
    In Render Pipeline Asset, you can delete second row (UniversalRenderer). I do not know, whether multiple renderers will cooperate, fight or ignore each other :)

    Working with 2D lights is very easy - just add Light -> 2D -> and light type. Each light has Blend Style property. By default there is only one blend style (multiply). But in your 2D Renderer asset you can define other blend types like this (we have Additive and Subtractive blend style):

    2D Renderer.png

    This is then difference (lights do not have the same intensity as additive is then really burning):
    Lights.png

    One more thing - when changing from LWRP to URP I had to set up postprocessing from scratch as URP has its own postprocessing stck.