2D Toolkit Forum

2D Toolkit => Support => Topic started by: DahongPunyal on February 03, 2014, 02:23:03 am

Title: Spotlight Effect Tutorial
Post by: DahongPunyal on February 03, 2014, 02:23:03 am
Is there any tutorial available to create a spotlight effect (almost similar to this post http://2dtoolkit.com/forum/index.php/topic,3118.msg15314.html#msg15314 (http://2dtoolkit.com/forum/index.php/topic,3118.msg15314.html#msg15314)) using tk2d?

I am using Orthographic camera (normal one). I also tried to switch the shader to lit one, and the collections' Normal Generation is set to Normals Only.

(http://i57.tinypic.com/dfk6e1.jpg)

When I use the lit shaders, the sprites darken but when I tried to apply a spotlight, nothing happens. Can I have any idea of how to do it, if there's no tutorial available or any other technique to achieve this? Also, I am new to Unity3D.

Thanks!

 
Title: Re: Spotlight Effect Tutorial
Post by: unikronsoftware on February 03, 2014, 11:51:59 am
Does it do anything if you have a unity sphere the same size at the same location? Does it work with an omni light / directional?
Title: Re: Spotlight Effect Tutorial
Post by: DahongPunyal on February 04, 2014, 01:17:46 am
I works now. I changed the shader from lit to diffuse :D.

Thank you!
Title: Re: Spotlight Effect Tutorial
Post by: DahongPunyal on February 04, 2014, 10:31:57 am
Oh, another thing.

I tried to used tk2d/LitBlendVertexColor, normals selected, and the lighting doesn't work.
Title: Re: Spotlight Effect Tutorial
Post by: unikronsoftware on February 04, 2014, 10:36:05 am
It does, but its vertex lit. It won't work with very small (smaller than a triangle) lights. Diffuse will work with pixel lights.
Title: Re: Spotlight Effect Tutorial
Post by: DahongPunyal on February 05, 2014, 01:16:05 am
Thank you!

The problem was just with the position and rotation. We can really close this thread now!

Thanks a lot!