• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by N00MKRAD · Aug 17, 2015 at 05:06 PM · androidlightingspotlightflashlightcookie

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: off

LIGHT ENABLED: on...

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image brunopava · Aug 17, 2015 at 07:56 PM 0
Share

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.

1 Reply

· Add your reply
  • Sort: 
avatar image
2

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.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image N00MKRAD · Aug 17, 2015 at 10:41 PM 0
Share

thanks for the answer!

I'm using Forward, I'll try deferred!

avatar image Twelv445 · Aug 17, 2015 at 10:58 PM 0
Share

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 :)

avatar image N00MKRAD · Aug 17, 2015 at 11:18 PM 0
Share

I can't use $$anonymous$$obile/Diffuse shader because it's not affected by spot lights.

avatar image Winterblood · Aug 17, 2015 at 11:44 PM 0
Share

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.

avatar image N00MKRAD · Aug 18, 2015 at 11:54 AM 0
Share

Changing the Render mode to Deferred only increased the performance by 2 or 3 FPS...

Your answer

Hint: You can notify a user about this post by typing @username

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

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

27 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges