Hello Guest

Author Topic: Spotlights at chunk borders on tilemap  (Read 3911 times)

dbanfield

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 30
    • View Profile
Spotlights at chunk borders on tilemap
« on: July 02, 2014, 08:54:48 am »
Hi
I decided to incorporate some spotlight lighting effects into my tilemap. I have everything set up (normals enabled, LitBlendVertextColor shader). Everything seemed to be working fine, but when I added more than 1 spotlight that were close to each other around a chunk border, the attached was happening.

I tried messing around with the spotlights to see if different angles affected it, but it didn't really change the problem. It seems also the spotlights don't necessarily need to be right next to each other, but at some point there is a cut off where if one spotlight is moved sufficiently far away from the other, the problem goes away. This distance is pretty far though, and far greater than the distance I need between the spotlights (each one represents a lamp post).

Any ideas what could be causing this?

Thanks
Dan

dbanfield

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Spotlights at chunk borders on tilemap
« Reply #1 on: July 02, 2014, 09:07:24 am »
Aaannnnd.... Solved within 10 minutes of posting this  ::)


I had to go into project settings -> Quality -> Pixel Light Count to bump up that value to something more sensible (default 2!). Working fine now  ;D

dbanfield

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Spotlights at chunk borders on tilemap
« Reply #2 on: July 02, 2014, 09:31:17 am »
Meh. Except when I deployed to android, the problem returns. I have read up about it and it seems there are various optimisation problems for spotlights on android. I could set the spotlights to "important" but FPS drops drastically.

Anyone have any suggestions?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Spotlights at chunk borders on tilemap
« Reply #3 on: July 02, 2014, 11:12:27 pm »
The lighting doesn't work when its using vertex lights. Thats when you see that weird border there, and it seems to be only used when you set the light to important. If you want to use unity lighting there isn't really much else you can do here, but bite the bullet and use pixel lights, which as you've found is slow on older hardware