Hello Guest

Author Topic: Lighting problems with Android  (Read 4464 times)

biggo

  • Newbie
  • *
  • Posts: 7
    • View Profile
Lighting problems with Android
« on: January 07, 2016, 09:02:21 pm »
Hi, I can't get spotlight (or other lightsources for that matter) to work on Android.

I don't know if this is a 2DToolKit issue?

If I apply a spotlight on a sprite/diffuse shader on one of the demo Unity projects, it works.
If I do the same on one of the 2DToolKit demos, no light is seen.

No problems with iOS.

Any ideas, what I can try?


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Lighting problems with Android
« Reply #1 on: January 07, 2016, 11:53:06 pm »
Hi there,

No idea why its not working on Android. 2D Toolkit uses the same lighting and shaders as the rest of Unity so if you create a normal plane and use a 2D Toolkit shader and stick a light in the scene, it should behave exactly the same.

Next switch the shader on the tk2dSprite to Diffuse and see if that changes anything. Could be an issue with vertex lighting in the version of unity you're on.

First thing I'd look at is the android specific settings.

biggo

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Lighting problems with Android
« Reply #2 on: January 08, 2016, 06:07:50 pm »
Found the reason! I forgot to add normals to the spritecollection. Funny it worked on iOS though?
« Last Edit: January 09, 2016, 02:20:39 pm by biggo »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Lighting problems with Android
« Reply #3 on: January 09, 2016, 09:44:10 pm »
It may work depending on what normals get fed into the buffers. Usually 0,0,0 but can be different - if its not 0, 0, 0 it will received *some* light, probably incorrect.