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 Cains · Oct 26, 2013 at 10:06 PM · optimizationframeratecullingslowing-down

Low framerate with culling mask set to nothing?

So at the moment all my game does is generate a world of tiles and objects, all in 2D (everything being quads with no colliders placed beside or on top of each other). I set the culling mask on the camera to nothing so that nothing is rendered and I got these stats in two separate cases.


10x10x9 world (~950 GameObjects)

http://puu.sh/50jHN/36c8bc477d.png


200x200x9 world (~380,000 GameObjects)

alt text


I guess I'm not really sure why the framerate is dropping so low when nothing is being rendered on the screen. These stats are after the entire world has been generated and the only script utilizing update() is simply checking for basic keyboard input and nothing else. Is the amount of GameObjects slowing it down this much? If so that won't be welcome news considering there's no way I can think of minimizing the GameObject count, and I was hoping to increase it.


Card name: NVIDIA GeForce GTX 560

Memory: 8192MB RAM

Processor: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz (4 CPUs), ~3.8GHz

Operating System: Windows 7 Home Premium 64-bit

Comment
Add comment · Show 12
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 sdgd · Oct 26, 2013 at 10:08 PM 0
Share

are you sure you aren't rendering the objects?

afaik if you can see them in editor you are rendering them in play mode if you see them or not.

only if the rendering mesh is disabled than you aren't rendering the objects

that feature comes with the Unity pro that you aren't rendering anything else than only stuff that can be seen with camera and AFAI$$anonymous$$ you need to add some behaviour script, ... but I'm not very knowledgable as I'm on Unity free my self

avatar image Cains sdgd · Oct 26, 2013 at 10:15 PM 0
Share

I'm fairly certain using the camera's culling mask to only render certain things is available on Unity Free. As you can see on the statistics the Draw Calls are down to 1, but if I set the culling mask back to everything it shoots up as it is now rendering the objects.

I can't actually see the objects in the editor since the world is generated by script at the start of the scene, but from the draw calls I'm fairly sure the objects are not being rendered. I could be wrong though as I just started using culling masks and layers.

avatar image sdgd sdgd · Oct 26, 2013 at 11:30 PM 0
Share

did you try by only deactivating all prefabs mesh renderer?

and all those objects are kinematic right?

I kinda remember having my infinity game where I first had everything rendered and more I opened about 200k objects more it slowed down and when I started deactivating rendering it speed up

avatar image Cains sdgd · Oct 27, 2013 at 02:53 AM 0
Share

I disabled the renderer on all GameObjects on start() and even then the FPS is still around 10. None of these GameObjects have any physics components.

So they're definitely not rendering, so the only thing I can think of to explain the low FPS is the large amount of GameObjects but it doesn't really make sense how that would lower my FPS so much. Large amounts of GameObjects is vital for my game so I hope this isn't the case.

Show more comments
avatar image meat5000 ♦ · Oct 27, 2013 at 12:11 PM 1
Share

http://answers.unity3d.com/questions/408298/max-number-of-gameobjects-5000-1.html

Framerate is not decided entirely by the graphical components. Having 380k Update functions to process will be demanding even if there is nothing in them. Even without scripts, trying to keep a handle on that many objects will take some time.

If each of those objects has a collider, that's 380k objects entered into a physics routine, which is far more demanding. This will of course, cause a hang.

Go through the camera culling one by one and see if any individual entry improves the situation, if you think that is what the problem is.

avatar image sdgd · Oct 27, 2013 at 12:24 PM 0
Share

hmmm, ... what @Eric5h5 said is you should parent some of the objects

like making 20 general parents and in their parents 10 children and after that all other game objects, ...

sounds reasonable, ...

in my labyrinth I had 1 parent having around 20 - 40 children

and all that parents were grouped in 1 parent

well it was easyer for me to manipulate all the game objects, ...

avatar image sdgd · Oct 27, 2013 at 12:41 PM 0
Share

@meat5000

I've just been reading just out of curiosity and found a strange thing I've never saw before ScriptableObject says with it it's possible to create about 2.5$$anonymous$$ objects before unity crashes, ...

going to make a Q about that

my curiosity made me make a Q

avatar image meat5000 ♦ · Oct 27, 2013 at 12:49 PM 0
Share

Sounds ideal :D

However if it said 2.5$$anonymous$$ objects before FPS drops < 30, it would be workable :D

Don't forget there are many many many other factors/game elements that also require a chunk of the ~0.0333 frametime.

If a 'game' is dragging on FPS only considering gameobject count there is no hope for an optimised Complete game.

That said, it would be very interesting to learn more of what Eric says on the matter :)

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Wiki

Answer by Cains · Oct 28, 2013 at 09:29 PM

The amount of GameObjects (380,000) was indeed slowing the FPS to a crawl, even though the GameObjects had empty update() scripts running between frames.

By making only a couple hundred GameObjects with custom meshes that hold thousands of tiles the FPS is significantly increased, well into thousands of frames per seconds compared to around ten. Creating custom meshes that hold many objects is definitely the way to go for procedural generation, at least in my case.

Unity's tutorial here got me going pretty quickly.

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

17 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

Related Questions

Android lag 1 Answer

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

Fast line rendering in 2D/3D 0 Answers

Game Object Backface Optimization for Mobile 1 Answer

Andriod (Oculus Quest 2 app) locked at 30 fps 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