Hello Guest

Author Topic: Problems with tilemap lighting after Unity update to 5.0.1  (Read 8263 times)

Quells122

  • Newbie
  • *
  • Posts: 18
    • View Profile
Recently, I was able to become an approved developer for a console (not sure if NDA'ed). In order for my game to be console compatible, I had to update my Unity version from 4.6.0 to 5.0.1.

Sadly changing versions seems to cause me problems with the tilemap lighting. I've attached a picture to demonstrate what I mean:

The tilemaps use the shader "tk2d/LitBlendVertexColor".

Is this a known issue? Any idea on how to fix? Help is greatly appreciated!


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Problems with tilemap lighting after Unity update to 5.0.1
« Reply #1 on: May 31, 2015, 05:09:31 pm »
Have you updated to the latest 2D Toolkit as well?

Quells122

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Problems with tilemap lighting after Unity update to 5.0.1
« Reply #2 on: May 31, 2015, 05:19:04 pm »
Yes. I re-imported the latest 2D toolkit from the Asset Store

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Problems with tilemap lighting after Unity update to 5.0.1
« Reply #3 on: May 31, 2015, 05:31:15 pm »
I haven't tested it on whatever platform you're on, but I have heard of / seen some issues with the vertex lit path in Unity 5.x. Try it with other modes (deferred / forward) and see if it works any better?

Quells122

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Problems with tilemap lighting after Unity update to 5.0.1
« Reply #4 on: May 31, 2015, 06:17:53 pm »
Unfortunately, changing to other modes like deferred does not work any better (it was on forward initially).

What seems to have "sorta" work, is if I change the tilemap's atlas material shader to "Sprites/Diffuse". However, it introduces another problem. The tilemap and the sprites are no longer evenly lit. Either the character is lit or the tilemap is lit. Animated tiles such as water need to be evenly lit with the tilemap or else they stick out like a sore thumb. Is there anything else I can do?





unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Problems with tilemap lighting after Unity update to 5.0.1
« Reply #5 on: June 03, 2015, 08:58:46 pm »
I'm running out of ideas. tk2d meshes are no different to Unity meshes. With any lit shader, you'd expect them to behave as any other object is lit. I guess you could try this with the Unity default shader, and make sure the normal generation is turned on in the sprite collection settings...

Quells122

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Problems with tilemap lighting after Unity update to 5.0.1
« Reply #6 on: June 04, 2015, 05:13:09 pm »
Thanks! Turning on normal generation seems to have done the trick. The tilemaps now respond to light and is evenly lit with other sprites.

I am curious what normal generation does and if there are any disbenefits to having it on? It seems to run with the same stats as before...


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Problems with tilemap lighting after Unity update to 5.0.1
« Reply #7 on: June 04, 2015, 05:43:50 pm »
Normals are required for lighting. The vertex data is a bit bigger but shouldn't make any noticable difference here. It might have been working by chance before that, but it shouldn't have :)