2D Toolkit Forum

2D Toolkit => Support => Topic started by: biggo on January 07, 2016, 09:02:21 pm

Title: Lighting problems with Android
Post by: biggo 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?

Title: Re: Lighting problems with Android
Post by: unikronsoftware 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.
Title: Re: Lighting problems with Android
Post by: biggo 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?
Title: Re: Lighting problems with Android
Post by: unikronsoftware 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.