|
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; } Any other hints? Thx heaps
(comments are locked)
|
|
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. :) You wouldn't be able to use static batching for billboards; the point of static batching is that the objects don't move.
Dec 21 '11 at 06:19 PM
Eric5h5
(comments are locked)
|
|
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. Mmh... A particle system? My 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?
Dec 22 '11 at 12:22 PM
KK
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.
Dec 22 '11 at 12:40 PM
Eric5h5
I highly recomend SpriteManager or similar which combines billboards/sprites with their textures (merged into one texture atlas) to one object. Thx for the pointers! reg
Jan 19 '12 at 02:21 PM
KK
@Jango do you know of any examples that demonstrate how to achieve this? Cheers for the tips!
Feb 26 '12 at 05:52 PM
numberkruncher
(comments are locked)
|
