0
\$\begingroup\$

I have only one object in the scene and it is lit with a directional light. It uses the mobile/diffuse shader. The issue is that on iPhone 4 the FPS drops from ~42FPS to ~11FPS when the directional light is enabled. Rendering is set to forward rendering and there are no other light sources. Shadows are not enabled.

Scene stats give a total of five draw calls, 3k tris and 2.6k verts. Having a single directional light should not have that kind of effect on FPS. What could cause this FPS drop?

enter image description here

\$\endgroup\$
  • \$\begingroup\$ if you have one material with a single directional light, no shadow received nor casted, you should have exactly one drawcall if you use mobile/diffuse. \$\endgroup\$ – Heisenbug Oct 14 '13 at 11:42
  • \$\begingroup\$ this sounds strange. could you explain a bit more about your code behind drawing the sceene? and also show the shader code?+ \$\endgroup\$ – Tordin Oct 14 '13 at 12:35
  • \$\begingroup\$ You might want to try setting the shader to "Mobile/VertexLit (Only Directional Lights)". See answers.unity3d.com/questions/198158/… \$\endgroup\$ – Adam Oct 14 '13 at 23:01
1
\$\begingroup\$

So after spending hours to figure out why it did that, it turned out to be rather simple. Even though the rendering was set to Forward in the player settings it was overridden to Deferred in the camera itself.

enter image description here

This caused more draw calls than it should have, as @Heisenbug pointed out, and the very poor performance as the iPhone4 is nowhere near capable to use deferred.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.