Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by KK · Dec 21, 2011 at 06:20 AM · optimizationframeratebillboards

Optimizing framerate on lots of billboards

I have a scene with lots of billboards (10.000+). There is occlusion- and per-layer culling going on. When most of the billboards are in view frustum the frame rate is about 30FPS. I am wondering why the frame rate remains low when the cam isn´t moving. What would be an appropiate method to let the scripts fall asleep if the cam is not turned?

Currently I am using LateUpdate() and if (renderer.isVisible). Here the code:


using UnityEngine; using System.Collections;

public class CameraFacingBillboard_up : MonoBehaviour { public Camera m_Camera;

 void LateUpdate()
 {
     if (renderer.isVisible)
     transform.LookAt(transform.position + m_Camera.transform.rotation * Vector3.back,
     m_Camera.transform.rotation * Vector3.up);
 }

}

Any other hints? Thx heaps

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Aleron · Dec 21, 2011 at 05:01 PM

How many draw calls are being made when you are seeing the 30FPS? (You can see them by turning on the Stats in the Game window of the editor)

My guess is that your low frame rate isn't related to script processing but rather GUI processing. One way to improve that performance is to reduce the number of draw calls being made by combining meshes and combining materials. Using static batching may be an option if your billboards are repeating a lot of the same static textures.

I'm far from an expert on this aspect of Unity, but this will hopefully help as a starting point. :)

Comment
Add comment · Show 2 · 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 Eric5h5 · Dec 21, 2011 at 06:19 PM 0
Share

You wouldn't be able to use static batching for billboards; the point of static batching is that the objects don't move.

avatar image KK · Dec 22, 2011 at 12:17 PM 0
Share

Thanks Aleron for the reply. Of course I have a huge amount of Draw Calls (5000+ @ 30FPS) but the profiler points out an issue with the scripts... @Eric, thats what I have been wondering about as well. I will comment your answer beneath.

avatar image
0

Answer by Eric5h5 · Dec 21, 2011 at 06:18 PM

Having 10K LateUpdate calls on 10K objects is a massive amount of overhead. You should use something more specific to this sort of thing like a particle system.

Comment
Add comment · Show 4 · 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 KK · Dec 22, 2011 at 12:22 PM 0
Share

$$anonymous$$mh... A particle system? $$anonymous$$y billboards are widely spread over a big area. They get culled by frustum and occlusion but there are still a lot visible at any point. I thought about to static batch them in distance and when you move closer they get individual. Could that work?

avatar image Eric5h5 · Dec 22, 2011 at 12:40 PM 0
Share

No, as I mentioned in the other answer, static batching only works on objects that don't move (rotating to face the camera is movement). What you're talking about sounds similar to the tree system, which isn't done with individual objects. It's not a particle system, but it's somewhat similar in concept.

avatar image KK · Jan 19, 2012 at 02:21 PM 1
Share

I highly recomend Sprite$$anonymous$$anager or similar which combines billboards/sprites with their textures (merged into one texture atlas) to one object. Thx for the pointers! reg

avatar image numberkruncher · Feb 26, 2012 at 05:52 PM 0
Share

@Jango do you know of any examples that demonstrate how to achieve this? Cheers for the tips!

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

7 People are following this question.

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

Related Questions

How to render severals cameras at differents Frame Rate ? 2 Answers

Android lag 1 Answer

Andriod (Oculus Quest 2 app) locked at 30 fps 1 Answer

Messenger.Broadcast VS GetComponent 1 Answer

Sudden Framerate drops at random times?? 2 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