- Home /
My Draw Calls go from 30 to 125 and I have twice as much tris/verts when I enable a spotlight. Why??
Hey there!
I am making a mobile game, and the player has a Flashlight (Spotlight w/ cookie).
When I disable this light (there are no other light exept ambient light) I get 30 drawcalls and 50 FPS on my phone, which is really good.
But when I have it enablen - and that's in most of the time - then I have 125 Drawcalls and 30 FPS, which is okay, but on older devices it will be only about 15, which is really bad.
Any workaround for that??
(Sorry for my english)
Profiler:
LIGHT DISABLED:
LIGHT ENABLED:
It depends on your shader. Some shaders adds extra tris and drawcalls under the influence of lights.
A workaround is to lightmap the whole thing. Or use unlit shaders.
Answer by Twelv445 · Aug 17, 2015 at 09:25 PM
Are you using Forward or Deferred rendering? In forward rendering objects need to be drawn multiple times for each light they are affected by. Try changing to deferred rendering this should increase your performance.
thanks for the answer!
I'm using Forward, I'll try deferred!
No problems! Let me know if it works for you, otherwise also as mentioned above - take note of shaders used. $$anonymous$$ake sure you're using the mobile shaders and if all else fails go for unlit shaders :)
I can't use $$anonymous$$obile/Diffuse shader because it's not affected by spot lights.
That's because lighting is expensive and mobile platforms struggle with it. If you use the more expensive shaders, you'll have to take a corresponding drop in performance.
Changing the Render mode to Deferred only increased the performance by 2 or 3 FPS...
Your answer
Follow this Question
Related Questions
Flashlight cuts off 180 degrees 0 Answers
Android Performance Issues with Spotlights in 3D Scene 0 Answers
Spotlight not lighting terrain? 6 Answers
Realtime spotlight shadows constantly flicker 1 Answer
Light Cookies on Android ? 1 Answer