Way to have 2D Sprites lit by Lights?

Is there any way to have lights actually apply lighting to 2D textures, without losing the transparency of the sprite? I have been using the Particles/AlphaBlended Shader to display my sprites.

I would like to have a dark room, and allow the player to use a light to make his way through, but I can’t seem to make lights work.

If there isn’t a way to make the stock lights work, then does anyone have another suggestion? I have heard of many ways to achieve similar effects, but I am not sure of the best approach considering Unity is built different than Engines I am used to.

Thanks
-Kreed

3 Answers

3

Create a material and use Sprite/Diffuse shader. Drag it to your sprite gameObject to apply the material. Voila!

NIce! Exactly what I was searching for!

Thanks :**

On the particle renderer material, use a shader that uses lighting.

The material used for the particle renderer.

Well, same answer basically...on the sprite renderer's material, use a shader that uses lighting.

Use a shader that has transparency and lighting.

Any of the Transparent shaders.

Sprites-default material does not respond to lights , but unity also supports another shader (Diffuse ) for sprites that supports lighting.

You just have to change the shader in Sprite renderer component

For more detail you can refer LINK REMOVED DUE TO MALWARE

That link won't let me open it until I install a Firefox Plugin, which I am definitely NOT going to do. Do you have a link which is less sketchy?

Now your link returns an empty page.

BEWARE: The link leads to malware, mods, please remove it.