Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 LiquidDarkness · Sep 09, 2015 at 06:59 PM · meshverticesmeshesprocedural meshreduction

How can I remove redundant vertices in custom mesh?

Hi, I've been working on a voxel-based model builder to create assets and characters for my voxel-based game. It has been working rather well so far, however I recently encountered an error with the amount of vertices in the model.

I was working on a model larger than my previous attempts, and I had almost finished when suddenly it disappeared and Unity threw a Mesh.vertices too large exception. I realized that with each voxel/block I was placing there was obviously a heap of vertices to go with it and that it was going to prevent me from building the size of objects I required.

And so I am looking for a solution that will allow me to reduce the amount of vertices in the models I create. One theory I have is somehow figuring out which faces are part of a larger face (i.e 4 squares alligned that make up a larger square) and then removing the vertices in the middle to create a larger face/triangles from the remaining corner vertices. I have no idea how to do this!

alt text

Simply ask for any pictures or code snippets that will be needed and I'll try and provide them as soon as I can. Thank you!

redundant-vertices.png (19.4 kB)
Comment
Add comment · Show 7
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 maccabbe · Sep 09, 2015 at 07:17 PM 1
Share

http://0fps.net/2012/06/30/meshing-in-a-$$anonymous$$ecraft-game/

avatar image Cherno · Sep 09, 2015 at 07:22 PM 0
Share

Look into "Greedy mesh algorithms".

avatar image Eudaimonium · Sep 10, 2015 at 10:50 AM 0
Share

Are you creating these models programmatically (by generating vertex and index arrays) or are you modelling them in external software?

If former, I recommend latter. You're talking about selective edge removal on co-planar surfaces. That's insanely complex.

I would recommend doing that in 3D software - in 3DS $$anonymous$$ax for example, to remove unnecessary edges, simply go into Edge edit more, select edge you want removed, and hit Backspace to remove only the edge, or Ctrl+Backspace to remove both the edge and it's for$$anonymous$$g vertices.

If you're talking about generating $$anonymous$$inecraft-alike environments from cubes and just want to optimize your world, then it's a different situation, which you cannot approach by removing edges from flat surfaces since different blocks use different textures (materials). Ins$$anonymous$$d, you need to only generate the surface blocks and then cull the sides of the cube that are not exposed (cannot be seen anyway). This also requires re-generating those sides when they will be seen, such as moving a neighbour block. Tons of articles on those approaches.

avatar image LiquidDarkness · Sep 10, 2015 at 11:02 AM 0
Share

Sorry for being vague. Yes i am using programmatically created meshes by specifying vertices and triangles that make up the objects. I would use an external program but this just happens to be the only way it will work for my particular application. I will look into greedy mesh algorithms and update back on here. Thank you so much for all of your replies! :)

avatar image Baste · Sep 10, 2015 at 12:31 PM 0
Share

Greedy mesh algorithms is probably the way to go. That being said, if you have some additional information about your meshes, you might be able to create something better/faster/easier than a generalized algorithm.

Example: I built some walls from quads, and figured that I should combine the entire wall into one mesh. Since I knew that the quads were all at the same height, and rotated one out of eight directions, I could pretty easily find continous walls of quads, discard every piece but the end pieces, and then create a new mesh from the furthermost verts of those meshes. A generalized algorithm would have worked, but it would probably have taken a lot more time to implement.

If your vert positions follow some kind of grid, or you know something specific about the rotations of your faces, you could do something similar.

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Getting mesh length (x,z) 1 Answer

How to add vertex points to a mesh 1 Answer

Mesh Collider not work with procedural mesh 0 Answers

Creating a convex MESH (not collider) 2 Answers

Is it possible to make vertices defined by a mesh and mesh filters animating? 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