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
1
Question by Conect11 · Dec 10, 2013 at 11:50 PM · gameobjectchilddrawcallscombinechildren

A theory / question about improving game performance

Hello friends,

It could probably be said that this might be better off in the forums, and I'm not opposed to that. Perusing them, however, I couldn't exactly figure out WHERE to put this topic, so I thought I'd post it in answers. Hope I'm not clogging up the place with it. So, this has to do with performance. I noticed after adding different models, textures, etc. that my framerate went way down, while my drawcalls and tris went skyrocketing. Ok, no problem. A little google search taught me about the "Combine Children" script. Always wondered what that was. Used it, and life seemed good.

For a moment.

Performance improved dramatically, but then I noticed that many of my combined meshes just plain weren't showing up anymore. I've read up on this, I see it's an issue that's been addressed, and while I haven't found a unified single answer, I know that the topic's been covered enough to not warrant one more noob asking about it.

So believe it or not, I'm not asking how to fix it. Not right now. Instead, I'm going to ask for opinions on a workaround that I've thought up. It's dawned on me that I might be drawing things unnecessarily in my game. For instance: let's say the town of bogville is 20 miles away from the spooky forest. Yet the spooky forest is still active on my map when I walk into the town of bogville. Would I save drawcalls, save on performance if I just put an invisible box collider nearer to the spooky forest which would activate / deactive it when the player is close? I suppose I could do this with any models that were collected in a gameobject throughout the game, my question is just would this be a way (good, bad, or ugly is irrelevant right now, I just am thinking proof of concept) of improving performance? Thanks, and God bless.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Statement · Dec 10, 2013 at 11:58 PM

For instance: let's say the town of bogville is 20 miles away from the spooky forest. Yet the spooky forest is still active on my map when I walk into the town of bogville. Would I save drawcalls, save on performance if I just put an invisible box collider nearer to the spooky forest which would activate / deactive it when the player is close?

You can toggle renderers on and off, yes. This should improve performance since Unity doesn't have to cull objects and since Unity doesn't have to render them (in case your frustum is super big, like the 1 KM frustum that is default with Unity).

I suppose I could do this with any models that were collected in a gameobject throughout the game, my question is just would this be a way (good, bad, or ugly is irrelevant right now, I just am thinking proof of concept) of improving performance? Thanks, and God bless.

It's a good thing to do. You can also use occlusion culling if you have Unity Pro.

Other things that may or may not be obvious is your render mode (try switching between deferred and forward) and try disabling lights (maybe you have too many dynamic lights). Use light mapping and light probes. Also check the number of materials you use, and make sure you actually use the same materials and don't do things like setting the color individually per item. For dynamic batching, you should not [non-uniformly] scale your objects. Everything that is staticly batched must not change.

Comment
Add comment · Show 5 · 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 Statement · Dec 11, 2013 at 12:01 AM 0
Share

$$anonymous$$ake changes, observe draw calls. See what gives the most bang for the buck. Try disabling all scripts in one copy of the level and see if that improves drawcalls (you may be messing with materials or changing transforms)

avatar image Conect11 · Dec 11, 2013 at 12:43 AM 1
Share

I appreciate that Statement, thanks. Am playing around with enabling / disabling gameobjects automatically now, and it seems to be giving me several fps performance boost.

EDIT - Additionally, I owe you one. I had no idea about what the rendering path was on my camera. Changing to forward gave me a three fold increase in rendering performance with a very acceptable downgrade in visual performance. Thanks!

avatar image Statement · Dec 11, 2013 at 12:53 AM 0
Share

There's a lot of options in quality settings too. Like you may be able to reduce shadow distance if you use shadows or lightmaps (dual lightmaps use the shadow distance to blend between realtime lighting and baked lighting for instance)

avatar image Conect11 · Dec 11, 2013 at 02:18 AM 1
Share

Statement, your advice has been incredibly valuable in increasing the performance output of my game :)

avatar image Statement · Dec 12, 2013 at 11:52 PM 0
Share

Great! (Graphics) Optimization is such a broad topic so it's hard to tell where to start in many cases. I'm glad you see a great increase in your app, but I'll throw in some more info in case someone else is stuck too and the limited info in the answer was poor help.

Using the statistics window and especially the profiler is a good step if you suddenly find yourself running short of juice. Even if you feel lost at using these tools, you could see what happens if you try to:

  • Turn off all real time shadows. $$anonymous$$aybe you've got too many lights that cast shadows, too many shadow casters or too many shadow collectors, or too far shadow distance?

  • Turn off all real time lights. $$anonymous$$aybe you have too many lights and should use lightmapping and/or light probes?

  • Swap out all materials to use a single material. Problems are likely inability to use batching or having multiple materials (will increase draw calls and possibly overdraw).

  • Swap out all shaders to use a $$anonymous$$imal shader. Problems are likely too complex shaders, too many passes in shaders, use of expensive operations etc. Other problems may be that you are rendering too many triangles with these shaders, or too big area of the screen with these shaders, or too much overdraw with these shaders.

  • Turn off cameras (if you have multiple) one by one. $$anonymous$$aybe you have items in a special layer that somehow causes a lot of issues? $$anonymous$$aybe you have too many active cameras that need to do frustum/occlusion culling (once per cam)?

  • Turn off all cameras. Still running slow? It's probably not graphics but your scripts or something else like physics or animation (if set to animate off screen) that is bottlenecking - check the profiler!

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

Display Name Above Object 2 Answers

Find a specific child of a GameObject with the collision data from OnControllerColliderHit 4 Answers

Combine children 1 Answer

Issue using separate GameObject to detect bounds 0 Answers

How to check parent value instead name value(more details in post) 3 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