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 falconfetus8 · Mar 10, 2013 at 03:10 AM · meshstatic

Does having a large number of identical meshes hurt performance?

Say I'm building a level, and I decide to repeatedly copy/paste a particular piece of level geometry over and over again to make it easier on myself. Would this have a negative effect on the computer's performance? The reason I ask is because TheNewBoston, a popular programming tutorial maker, claims that these things called "Static Meshes" can be re-used again and again and again without too much extra work for the graphics card. The specific video that he says this in is: http://youtu.be/ueM9K-hutAE?t=5m35s (skip to about 5:35)

What I want to know is: does Unity have something that is equivalent to UDK's "Static Meshes"? Or are Unity's meshes already technically "static" by default? If such a thing does not exist in Unity, then is there some kind of add-on for Unity that adds it? Thanks in advance!

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
1

Answer by nsxdavid · Mar 10, 2013 at 03:41 AM

You are probably referring to the concept of batching draw calls. Unity can do this in a couple ways:

See: http://docs.unity3d.com/Documentation/Manual/DrawCallBatching.html

In the case of static objects, this would be Static Batching. It is not on by default, but you just need to click the Static checkbox in the inspector.

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 Statement · Mar 10, 2013 at 04:02 AM

For the simple case: Does copying a mesh incur significant memory overhead?

No. Go ahead and make copies of your mesh. It will most likely reuse your mesh. But keep reading for the exceptions:

However, if you have static batching enabled and if your meshes are static, then it means that the vertex data will be baked together to a single mesh. This means that it will use more memory, but it does this to render faster. It is not a good idea to make everything staticly batched since this could completely blow away your free RAM.

Another however; if you make copies of your mesh and they are not static, everything is nice and fine until you set a non-uniform scale on some of the objects. That is, if you have a tree model and make a forest of trees, you might want to make them look a little bit different so you rotate them a little and scale them a little and that's fine, but if you scale them non-uniformly for example to (2, 2, 2.4), then Unity will generate a new mesh for performance reasons. This has to do with normals on the models, where non uniform scales mess with normals. It would be possible to handle this in a shader but that shader would become complex and slow and instead another Mesh is used, trading memory for runtime performance. Uniformly scaled meshes are no problem since we can just update a shader property with the uniform scale.

To put it simple: Scale 1, 1, 1 is fine. 2, 2, 2 is fine. 3.57, 3.57, 3.57 is fine. 1, 2, 3 is not (well it's fine, but you should keep in mind that the mesh will be duplicated in memory).

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 Statement · Mar 10, 2013 at 04:07 AM 0
Share

And @nsxdavid has a link to the docs that explain static and dynamic batching. On second thought perhaps you only needed a link to how draw call batching is done :) But oh well, the more information the merrier.

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

Re-meshing Static Objects as one mesh? 1 Answer

Occlusion Culling with Static Mesh Render Object 0 Answers

Why isn't my static batching working? 1 Answer

Materials disappear on Mobile when more then one is set to static batching. 0 Answers

Can I not use static objects with the Local Nav Mesh Builder? 0 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