Search Unity

Unity 2D LWRP Y-depth lighting

Discussion in 'Shaders' started by BlueSin, Sep 11, 2019.

  1. BlueSin


    Apr 26, 2013
    Hey all, recently read an article from Svyatoslav Cherkasov on how they did some of the lighting effects in Unity for their game Graveyard Keeper (article found here). I have been using Unity for about 5 years now but am just starting to delve into the more advanced stuff for 2D games like the new LWRP, shadows, shaders, LUT, normal maps, etc.

    So today my question is on a particular portion of the article linked above. Somehow he created a shader that uses y-depth lighting. Now Graveyard Keeper has been out for some time so obviously this was before the LWRP implemented 2d lighting, and probably uses Unity's 3D lighting system. Please see the attached graphic for an example.

    My question is, how would I go about building a shader or create this lighting effect using the LWRP for a top down game in Unity? I know very little about shaders. I'm also curious about the shadows, but that's another topic for another time. Mostly I am curious about the Y-depth lighting and sorting here. Thanks in advance if anybody has an idea!

    Lars-Steenhoff likes this.
  2. mouurusai


    Dec 2, 2011

    I don't know how implement this with shader graph, but if you find why shader graph does not receive position for point light, converting should be pretty straightforward I surpos.