Hello Guest

Author Topic: Spotlight Effect Tutorial  (Read 4877 times)

DahongPunyal

  • Newbie
  • *
  • Posts: 15
    • View Profile
Spotlight Effect Tutorial
« 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) 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.



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!

 

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Spotlight Effect Tutorial
« Reply #1 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?

DahongPunyal

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Spotlight Effect Tutorial
« Reply #2 on: February 04, 2014, 01:17:46 am »
I works now. I changed the shader from lit to diffuse :D.

Thank you!

DahongPunyal

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Spotlight Effect Tutorial
« Reply #3 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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Spotlight Effect Tutorial
« Reply #4 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.

DahongPunyal

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Spotlight Effect Tutorial
« Reply #5 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!