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

How to add lighting to 2d scene

Discussion in 'UGUI & TextMesh Pro' started by AprendaGames, Aug 27, 2014.

  1. AprendaGames

    AprendaGames

    Joined:
    Jan 4, 2012
    Posts:
    49
    I've read in a few places that it's possible to add lighting to your 2D scene, but can't seem to figure out how to do it. I've just added some 2D sprites to the scene and added a point light. Any help would be appreciated.
     
  2. Spellbound

    Spellbound

    Joined:
    Sep 9, 2011
    Posts:
    51
    You must assign a material/shader that supports light sampling, like Sprites > Diffuse. As far as I know the default sprite shader simply applies self-illuminated (emissive) shading.
     
    Last edited: Aug 27, 2014
    AprendaGames likes this.
  3. AprendaGames

    AprendaGames

    Joined:
    Jan 4, 2012
    Posts:
    49
    Okay, I put a transparent diffuse texture on it and it works . . . ish. I get some really strange behavior when light will stop at the edge of the next sprite over. Also, I can't seem to get shadows to work. Still, progress. :)
     
  4. Spellbound

    Spellbound

    Joined:
    Sep 9, 2011
    Posts:
    51
    I am not sure, but isn't shadow casting only available for mesh renderers?