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 Foemass · Mar 29, 2013 at 05:24 PM · iosperformanceoptimization

Should large amounts of static objects outside of the camera’s clipping planes range be lagging my iOS game?

Hello, so I’ve been busily developing a 3D game with a top down one-direction camera for iOS and its been performing wonderfully on my iphone 4. However upon testing the game in a much larger scene with a lot more scenery objects the game lags itself into oblivion. (Phone-side only lag, no such issues when running on the mac)

These additional scenery objects are not within the camera’s clipping planes range and should presumably not be being rendered. Furthermore these objects are mostly just basic primitives (Cubes and such), with some of them being textured planes instead. They have no scripts, do not get initiated or destroyed and shouldn’t be being referenced by any other scripts.

I had assumed, perhaps foolishly, that because of Unity’s Frustum Culling the performance impact of a large level populated with nothing but static scenery (both in the sense that the objects just sit there, and the sense that I’ve tried toggling static on them) would be minimal. However as the game performs fine when I make two-thirds of the level’s scenery inactive, I’m guessing I was wrong.

(Just to clarify the lag is stopped by making objects outside of the camera’s clipping range inactive, the same amount of triangles are visible on the screen as were prior to the lag)

Obviously I’m no expert and a little confused to why this is happening, so I’d just like to make sure that I’m barking up the right tree here, and that large amounts of scenery not currently being rendered does in fact put a lot of processing strain on the platform. Just to make sure there isn’t some kind of hidden other system in my game responsible for this lag.

Assuming it is simply the sheer number of objects in the level causing my issue, any suggestions on how I could work around this would be welcome, other then just reducing the size of the level ^^. For example I’m toying with the idea of making the level’s scenery activate and deactivate as the player moves round it, since the level seems to work fine with most of the off screen scenery inactive.

Apologies for the wall of text, just trying to make my situation as clear as possible, thanks in advance for any and all responses.

Comment
Add comment · Show 9
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 whydoidoit · Mar 29, 2013 at 05:25 PM 0
Share

Are you running Pro? If so profile it.

The frustum culling takes time...

avatar image whydoidoit · Mar 29, 2013 at 05:26 PM 0
Share

As for suggestions - do your own logic for turning these extra items on and off if you can... It could also be trying to batch them and creating an unholy mess of the frustum bounds check (but that's less likely).

avatar image Foemass · Mar 29, 2013 at 05:37 PM 0
Share

Only using basic i'm afraid.

Is there any way for me to check if unity is trying to batch them?

Thinking back the guy who made the scene did make the entire level under one parent object for organisation's sake, could that be causing them to be batched? (Though i'm not entirely certain on what that means TBH ^^)

You say the frustum culling takes time... It is an automated process though? I'm not missing some kind of setting for it somewhere which might have been set incorrectly and be resulting in my problem.

avatar image whydoidoit · Mar 29, 2013 at 07:13 PM 0
Share

Frustum culling is automatic and cannot be disabled (nor should it be). You can disable static and dynamic batching in the Player Settings which might be worth a go.

Putting everything under a parent shouldn't be a problem - things batch which are in proximity and share a material. Doing your own "turning things off" would be a good idea if you can find conditions where things should not be displayed.

avatar image whydoidoit · Mar 29, 2013 at 07:13 PM 0
Share

How many objects are we talking about?

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by emiller100 · Mar 29, 2013 at 07:10 PM

Frustrum culling happens automatically. In the editor it will not if one of the views is also showing the objects. Did you actually deploy your game to the device? Do your objects have scripts? The only thing the culling will turn off is the renderer. The scripts attached will still run.

Comment
Add comment · Show 1 · 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 Foemass · Mar 29, 2013 at 07:53 PM 0
Share

The objects have no scripts attached to them and the game is being deployed to an iphone4, it does not lag whilst played undeployed on the development mac.

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

12 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

Related Questions

iOS: Performance gain by disabling accelerometer? 1 Answer

How to improve FPS on mobile? 1 Answer

Why did my render time increase after lowering the vertex count? 2 Answers

Lots of Skinned Characters iOS Performance 0 Answers

Are there any performance differences between a timer and using Invoke? 1 Answer


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