2D Toolkit Forum

2D Toolkit => Support => Topic started by: DJVDJV on January 26, 2016, 10:30:02 am

Title: 2DTK and lights
Post by: DJVDJV 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.
Title: Re: 2DTK and lights
Post by: unikronsoftware 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.