Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

2D Fake Lighting?

Discussion in '2D' started by kaustek, Feb 12, 2015.

  1. kaustek

    kaustek

    Joined:
    Oct 5, 2013
    Posts:
    7
    I was wondering if anyone has an easy method to do some fake lighting in Unity.

    With other engines, I accomplished this by drawing a dark surface over top of all layers (minus GUI) then subtracting the "lights" by subtracting the alpha channel. It was quick and dirty but I haven't really seen anyone really doing this with Unity.

    I know the idea behind it is simple but I can't really can't find anything in the API reference about creating seperate draw surfaces like GameMaker for example.

    Ideas, Comments welcome
     
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Just chatted about this earlier.
    Thanks to @Aedous for explaining the technique.
     
    Aedous and kaustek like this.
  3. kaustek

    kaustek

    Joined:
    Oct 5, 2013
    Posts:
    7
    I'll have to give that a try!
     
  4. Aedous

    Aedous

    Joined:
    Jun 20, 2009
    Posts:
    244
    Let me know how you get a long, I'm not good with shaders at all, and my method only gives you a specific type of light :). However since it's a sprite I guess your light can be any shape.