[SOLVED] Pixel shader looks different in iOS?

I’ve got a pixel shader that looks correct on DesktopGL and Android projects, but the iOS project renders totally wrong:

The goblin dude should be green, not dayglo yellow :frowning:

Is there anything different about pixelshaders in iOS? The shader code is available here if anyone can take a look:
pixelshader

Cheers!

It almost looks like it’s applying the pixelshader to the entire texture instead of per pixel?
Still not sure what is going on :frowning: I’ve been tearing bits out of the code to try and get it to at least a baseline working state, but no luck.

So the other night, I woke up at 3AM and shot out of bed: “It’s not applying the shader per-pixel because the normal map isn’t being loaded! It’s lighting the texture as a flat quad!”

The first, stupidest, thing I could think of was to bump up the image size to the nearest power of 2.
SuccessKid.jpg:

So there you go: Normal map images on iOS have to be a power of two. At least on the simulator.

2 Likes