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 Hotshot10101 · Nov 08, 2012 at 08:22 PM · rotateslowframe rate

Rotating a Ton of Game Objects

I have an object in the middle of my scene that needs to be rotated. The camera is also moved in and out (zoom) as well as up and down (pan).

I have all the rotation and camera movement working just fine.

This object is made up of 10000 individual objects. They are spaced out around the center at random locations, but their locations relative to the parent object never changes.

The individual objects are made at run time using the Instantiate feature on a prefab model and then the parent of each object is made to be the main parent object that I am rotating. This way all of the individual objects do not have to be rotated individually. Rotate the parent = rotate them all.

The problem I have is frame rate. There are a couple of things that are weird to me.

The first weird this is that initially I have my real prefab. This is a pretty cool model with textures and glow features and animation.

If I turn on the stats window I see 3M tris and a frame rate of about 13 FPS. This is actually pretty good considering, but obviously not good enough.

I can rotate, pan and zoom and the frame rate stays about 13 fps. As I zoom in and fewer objects are on the screen the fps does go up as you would expect.

Now here is the weird part. I decided to just make a simple cube model and replace the fancy object with this model. That is the only change. When I start it up the fps is about 40. That is expected. They are just cubes after all and the tris are now at about 50k instead of 3M. What I did not expect is that now when I rotate the frame rate goes to 1 fps. Panning and zooming does change the fps except as you zoom in it goes up to over 90 fps.

Why does rotating cause just a jump? Why does using a cube cause MORE of a jump than using the fancy model?

Last question is that I am looking for suggestions. I can't image that Unity can't handle rotating 10000 objects. Can someone help me out here?

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
Best Answer

Answer by Hotshot10101 · Mar 13, 2014 at 09:52 PM

I ended up rotating the camera instead of rotating the 10000 objects. I should have thought of this originally, but was thinking backwards.

The slow down is mostly likely the process of iterating 10000 objects in scripts. I would guess as each object is rotated that also added a drawing operation.

By moving the camera instead there is only a single object to iterate (the camera) and the movement of the objects is handled by the engine which is much faster.

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

Answer by patben8 · Nov 08, 2012 at 08:39 PM

To fix the frame rate problem try going to the tender setting and adding fog. I know we all hate it but it sometimes works.

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 Hotshot10101 · Nov 08, 2012 at 09:52 PM 0
Share

Thank you for the suggestion. It didn't help.

Except for the fact that the complex model isn't affected by the rotate I believe this is probably not a rendering issue, but rather a rotate all those objects issue. Any ideas on that?

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

10 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

Related Questions

A node in a childnode? 1 Answer

Rotate camera around player 2 Answers

Help! My game stutters and I don't know why 0 Answers

Functions via camera rotations... 1 Answer

MonoDevelop Loads Really Slow on Mac 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