Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 /
  • Help Room /
avatar image
0
Question by Tariq-mehmood · Mar 23, 2017 at 04:11 PM · lightinglightsframes per secondpreformance

Lights in Scene reduce farms per Second(FPS)

Hi Everyone

I am working on a project(game) in which police cars are involved therefore I have created car models and for a realistic effect I have used blue and red area(baked only) lights but my scene involve about 30 cars with mean 60 these type of lights are going to be used but when I only used 6 cars which mean 12 lights and my FPS dropped to 3. I am using this area light because other lights make batches high and FPS low. I am using Realistic car control kit and Smart AI kit in this game. I am using one script that is activating red and blue light Randomly.

     using System.Collections;
     using System.Collections.Generic;
     using UnityEngine;

     public class BuleLightRoatatingScript : MonoBehaviour {
     public GameObject buleLight;
 public GameObject RedLight;
 public int rendomNum;
 // Use this for initialization
 void Start () {
     
 }
 
 // Update is called once per frame
 void Update () {
     rendomNum = Random.Range(0, 2);
     if(rendomNum == 0)
     {
         buleLight.SetActive(true);
         RedLight.SetActive(false);
     }else if(rendomNum == 1)
     {
         buleLight.SetActive(false);
         RedLight.SetActive(true);
     }
   //  transform.Rotate(0, -300 * Time.deltaTime, 0);
 }
 }

now is there any way that I can use 60 lights in one scene without FPS drop and for android FPS has to be 30 to 40 and if not that how many max lights can I used in one scene

thanks in Advance

Comment
Add comment · Show 5
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 hexagonius · Mar 23, 2017 at 11:16 PM 0
Share

if your lights are need only you shouldn't have any problems. but since you're toggling them you're probably using them realtime. lights are expensive, if you must use a lot mark them all not important which makes them vertex lights, not pixel lights. use layers to only illu$$anonymous$$ate what's relevant. since you're on android you're probably using forward rendering mode which means every object effected by light gets a draw cell per light. there's no way in telling how many lights your scene can handle since it depends on light ranges, object counts, vertex or pixel lights

avatar image Coleclaw199 hexagonius · Mar 24, 2017 at 12:46 AM 0
Share

You're right. He/she shouldn't use Realtime lighting. Use baked or mixed lighting.

avatar image Coleclaw199 hexagonius · Mar 25, 2017 at 06:21 AM 0
Share

Sorry, but I don't know. The only possible way for me to help is if I had a closer look at your project.

avatar image Coleclaw199 hexagonius · Mar 25, 2017 at 06:22 AM 0
Share

Replied to wrong person, sorry. :P

avatar image Tariq-mehmood · Mar 24, 2017 at 10:17 AM 0
Share

Thanks for this early reply @hexagonius and @Coleclaw199 but I am using baked only light mean area baked only light but still facing FPS issue when I have 5 cars in my scene which mean 10 lights so FPS are 10-15 but when 6th car is enabled fps dropped :( don't know what to do??

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by AurimasBlazulionis · Mar 24, 2017 at 10:28 AM

1) You can not use area lights on moving objects.

2) Lower pixel light count in the quality settings

3) Make sure shadow casting is disabled on these lights.

4) Switch to emissive materials if the above is not the case.

5) If you really need lights force deferred shading. This will increase CPU usage, though.

Comment
Add comment · 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

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.

Follow this Question

Answers Answers and Comments

111 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 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 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 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 avatar image avatar image avatar image

Related Questions

Working with colored light, in completely ambient-lit scene 0 Answers

Lighting a bloodvessel from the inside 0 Answers

Lighting question 0 Answers

Have realtime light cast shadows on terrain only, not trees and details. 1 Answer

HDRP Realtime Lights not working 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges