x


Before updating to Windows 10 you may need to return your Pro license. More information here

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

more ▼

asked Dec 13, 2011 at 08:39 AM

avatar image

kreed
1 14 12 13

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

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

more ▼

answered Feb 23, 2014 at 08:34 PM

avatar image

zee_ola05
802 5 14 28

(comments are locked)
10|3000 characters needed characters left

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

more ▼

answered Dec 13, 2011 at 09:04 AM

avatar image

Eric5h5
121k 78 361 774

I am confused by your comment. What do you mean by the "particle renderer material"?

Dec 13, 2011 at 02:42 PM kreed

The material used for the particle renderer.

Dec 13, 2011 at 02:46 PM Eric5h5

Oh, I believe you misunderstood the question. I am using a texture on a plane for my character's sprite. I want to light him, not a particle system.

Dec 13, 2011 at 02:46 PM kreed

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

Dec 13, 2011 at 02:56 PM Eric5h5

Use a shader that has transparency and lighting.

Dec 13, 2011 at 03:17 PM Eric5h5
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x15037
x4210
x1615
x1167
x456

asked: Dec 13, 2011 at 08:39 AM

Seen: 5448 times

Last Updated: Feb 23, 2014 at 08:34 PM