Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    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?