x


iPod Touch normal mapping errors

I have an issue with pixel lighting in Unity 3b7. Since images speak louder than words, here you go:

alt text

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.

alt text

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?

more ▼

asked Sep 13, 2010 at 05:34 PM

noradninja gravatar image

noradninja
955 45 43 76

(comments are locked)
10|3000 characters needed characters left

1 answer: sort oldest

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

more ▼

answered Sep 14, 2010 at 02:17 PM

noradninja gravatar image

noradninja
955 45 43 76

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3192
x891
x160
x97
x44

asked: Sep 13, 2010 at 05:34 PM

Seen: 2161 times

Last Updated: Sep 13, 2010 at 05:34 PM