I have an issue with pixel lighting in Unity 3b7. Since images speak louder than words, here you go:
This is how my sign looks in the Unity Editor. I am using a Bumped Specular shader. I have OpenGLES 2.0 emulation on (altho it looks the same with no emulation). This is as it should be.
This is how the sign renders on the actual device (iPod Touch 4th Gen, 8GB). You can see that the normal mapping is functioning correctly, but the light appears to be vertex lighting the front of the sign, which is a subdivided plane. I have tried it with a simple plane (two tris) and the vert lighting effect is even more pronounced (This is REALLY obvious as the shading lerps across the verts when you animate the light).
So I suppose my question is this: how do I make the output on the device match the output in the Editor? If the IPT is capable of pixel shaders/lighting, why am I getting this weird belnd of pixel and vertex lighting?
asked Sep 13, 2010 at 05:34 PM
Figured it out! In the import options ofr the model, you have to set Unity to generate tangents for the model because the shader needs surface tangents to light properly. I feel kinda silly, but Im glad its working now.
Pixel shaders on the iPhone/iPodTouch...I think I am going to fall over from the coolness of it all :D
answered Sep 14, 2010 at 02:17 PM