• 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 David Rodrigues · Apr 19, 2016 at 08:50 PM · renderingperformancecube

Should I care about invisible meshs?

It is hypotethical question...

Supposing that I have eight cubes { 1f, 1f, 1f }, and it is forming a big "pseudo" cube { 2f, 2f, 2f }. These cubes have all six faces but, in general, it is not visible (the internal faces).

alt text

Illustration: keep in mind that the left cube is just to show how it is built. In general, it will be rendered like the right cube.

The question is: should I care about it? It can affect game performance/memory usage if, for instance, I have a lot of this big cubes (some thousands) vs. have only single big cubes?

My question is because I don't know how graphic card (or some else) can optimize things like that.

cube.png (27.7 kB)
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
1
Best Answer

Answer by Soraphis · Apr 19, 2016 at 09:17 PM

well, without testing it: 1 big cube vs 27 small cubes (3x3):

  • memory usage:
    • mesh: the big cube has 8 vertices, aswell as each of the small cubes has, so your vertex buffer is 27 times larger.

    • components: in unity every object has a transform component, each of your cubes has a render component and each of them (could) have a collider, so this would also take 27 times more memory than a single cube

but i think you dont need to care much about memory usage if the factor is less then 1 big cube vs 100 mini-cubes

  • performance:
    • rendering: assuming all those cubes share the same material, there should not be much of a difference between 1 big cube and many mini cubes

    • collision: depends. if all those cubes should behave physical correct (are not static, are attracted by gravity and other forces, ....) it will hit your performance hard.

you should make sure that the cubes dont collide with each other if they dont need to, and that as many static flags are set as possible

edit: to answer a bit more directly to your question about invisible faces: IIRC, stuff like backface-culling and occlusion-culling is done by the graphics card, so you'll need the memory for all the vertices if they are visible or not. and even if most of your poligons dont need to be drawn (because they are invisible), you'll atleast get a small performance hit because your front-face is also splittet.

it does not rly matter how large an object is. a 3meter x 3meter cube is rendered as fast as a 1 meter x 1 meter, and they use the same amount of 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 David Rodrigues · Apr 19, 2016 at 09:49 PM 0
Share

In a real case, each 1f cube will have avg of 300 $$anonymous$$i cubes, with a single colision box for the big cube, but each of $$anonymous$$i cube can have more than one material attached. I guess that it will be very slow in a big world of these cubes. But thanks for fast reply!

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

how to i off load rendering to my gpu? 0 Answers

slow rendering and frozen frames in unity 2019.4.16f 3 Answers

Do non-rendered gameobjects use memory? 1 Answer

Planet made out of terrains 3 Answers

Performance drop with transparent objecs overlying big meshes 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