Hello Guest

Author Topic: 2DTK and lights  (Read 3772 times)

DJVDJV

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 30
    • View Profile
2DTK and lights
« on: January 26, 2016, 10:30:02 am »
Hellos,

I got 4 different 2dtk tilemap in my game. Now I want add light that affect every tilemap. Because tilemaps seems be in different z in enginewise I need do nor 4 x light with different z:s (one light for every tilemap). How I can do light that is not affected by z so just one light that light every tilemap.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2DTK and lights
« Reply #1 on: February 02, 2016, 10:31:39 pm »
Not easily. Unity lights are 3d lights, and if you have a z difference naturally you'll have a difference in lighting. You could, I suppose reduce the z separation to reduce the effect of the lights in there. Alternatively, you could change the shader so it ignores the input z value - so the points all draw at fixed z depth (and lighting is performed at that depth) but you'd get the desired z sorting.