Single point light with non-mobile shaders killing performance on ios

I’m using a single point light that is fixed to the FPS player camera as a flashlight. I need to be able to disply per-pixel lighting so instead of using the mobile diffuse shaders I am using the standard diffuse shaders, everything runs great for android on my Samsung Epic 4G, however, the frame rate is very choppy on iPod Touch 4G.

I am using T4M Terrain to convert unity terrain to a mesh which i is around 3,600 verts. If I change the terrains shader to mobile but leave the rest of the walls, tree, props, etc… using the non-mobile unity diffuse shaders it runs fine. however, I need to use a shader that dfisplays per-pixel lighting on the terrain as well.

Here are the average stats:
Draw Calls: 25 - 30
Tris: 10k Verts: 8k

What I’m wondering is, weather there is a shader that supports per-pixel lighting but has better performance on iOS than the standard diffuse shader?

Thanks in advance!
Todd

I don’t understand why people here are always phrasing it, “Is there a shader…”? Shaders are not magic, unfathomably-created building blocks. You wouldn’t expect all the scripts you need to be created already. Why would it be different for shaders?

Yes, you can write code that will run faster given your specific needs.

Sorry, I’ve never written any shaders before, so it is unlikely that I will be able to write a shader that performs better with pixel lighting than a shader written by an experienced shader programmer, such as the dev who writes Unity’s shaders. That said, it made more sense for me to ask if anyone knew of a Unity shipped shader that can displays per-pixel lighting more efficiently than the standard diffuse.

I know, I need to work through tutorials and fill in that massive gap in my skill set that every game programmer should know. Still, I didn’t think it would hurt to ask for help.

We can probably give you help if you need it, but optimizing shaders with lighting can get pretty involved. The fewer features you need supported in the shader, the faster it can run.

iPod 4 is low fill rate device with many pixels (as bad as iPhone 4 and only a bit better than iPad1). It might be overkill for it to handle pixel lights (it depends a lot what you are doing else in the scene). Easiest solution would be fall back to vertex lights on slow devices and use pixel lights on faster devices. You can switch it globally in two ways:
a) switch rendering path in your camera from forward to vertexlit
b) change shader LOD value : Unity - Manual: ShaderLab: assigning a LOD value to a SubShader