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 Case23 · Jul 09, 2010 at 02:03 PM · meshcombinemeshes

Mesh.CombineMeshes Problem. Are there limitations?

I try th combine 15000 cube Meshes into one single Mesh.

I do it like this:

// i have a Dictionary of cubes which i reference to some information, // and contains 15000 cubes public Dictionary<string, GameObject> cubes; // i also have an Mesh created in the Start() function public Mesh mesh = new Mesh();

CombineInstance[] combineMeshes = new CombineInstance[cubes.Values.Count]; int count = 0; foreach (GameObject c in cubes.Values) { MeshFilter mF = c.GetComponent<MeshFilter>(); combineFileMeshes[count].mesh = mF.mesh; combineFileMeshes[count].transform = c.transform.localToWorldMatrix; count++; }

mesh = Mesh.CombineMeshes(combineMeshes); mesh.Optimize();

After i did this, the cubes existed, and the cubes in the mesh should look the same. But they dont. Are there limitations how many objects you can combine in a single Mesh?

Comment
Add comment · Show 1
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 Case23 · Jul 09, 2010 at 03:26 PM 0
Share

It realy looks like there are limitations. I tryd to use two $$anonymous$$eshes, which both only holds 10000 cube meshes, and now i can see much more, but still not all.

1 Reply

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

Answer by jonas-echterhoff · Jul 09, 2010 at 03:44 PM

Meshes in Unity cannot have more then 65536 vertices, because indices are 16 bit numbers internally. So, given that your cubes have 8 vertices each, you cannot have more then 8192 cubes in one mesh (does not matter if it is created using Mesh.CombineMeshes or by other means).

Comment
Add comment · Show 3 · 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 Case23 · Jul 09, 2010 at 05:28 PM 0
Share

Thanks again jonas! Perfect Answer!

avatar image Steven-1 · Jan 08, 2013 at 01:52 PM 0
Share

I recently noticed I managed to create meshes in code with more than 100000 vertices each. I guess the limitation has been removed? (I'm using the latest unity 3 version btw)

avatar image jaxsonmyrick · Jul 29, 2018 at 05:16 AM 0
Share

I was making a mesh and I learned the limit is smaller than 8192 cubes. It is actually 2730 cubes because cubes must have 24 vertices and not 8 (source: https://answers.unity.com/questions/143109/why-does-a-primitive-cube-contain-24-verts.html) Basically, each face must have 4 unique vertices for normals for lighting. I was making a 3000+ cube mesh and was puzzled. I'm happy to contribute to the discussion for once :)

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

CombineMeshes result invisible. 0 Answers

CombineInstance[] submesh index 1 Answer

How to avoid or turn-off "Combined mesh (root scene)" feature. 3 Answers

Combining Objects for Performance 0 Answers

How to combine vertices while removing duplicates AND inheriting connections? 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