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
1
Question by pmerilainen · Jul 11, 2019 at 09:36 AM · meshoptimizationtriangleslod

Sharing vertex buffer between mesh objects

Is there possibility to share vertex buffers between Mesh Objects. I have baked some bezier patches to Mesh objects. I would like to create a LOD version of a bezier patch; can I re-use the vertices from one mesh and just use different triangles (index buffer) to reduce poly count. This is trivial to do with pure graphics API but I have not found a way to do it with Unity meshes.

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
0
Best Answer

Answer by Bunny83 · Jul 11, 2019 at 10:18 AM

No, Unity does not support that. A Mesh instance actually "owns" its native vertex and index buffers. Unity provides methods like "GetNativeVertexBufferPtr" for native code plugin usage. However there is no way to set the vertex buffer of a Mesh class instance. You would have to assign the same vertex array / List to both Meshes which of course would duplicate the vertex buffer on the GPU. Though since you said it's pre baked it would make more sense to actually use a trimmed down vertex list as well.


However if it's important for you to save GPU memory you can do this if you handle everything in a native plugin. Of course native rendering plugins have to consider the actual used graphics interface which is different on most platforms. For more information see NativePluginInterface

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 pmerilainen · Jul 11, 2019 at 10:40 AM 0
Share

Seems to be more trouble than it's worth then. I was just thinking to replace far-away patches to meshes with simpler geometry; but the GPU memory is more important than the $$anonymous$$or performance gain I can get from reducing polys. (in my system there are already simplified shaders for faraway objects etc..).

avatar image Bunny83 pmerilainen · Jul 11, 2019 at 10:51 AM 0
Share

$$anonymous$$eep in $$anonymous$$d that Unity already has an LOD system. All you have to do is provide seperate meshes, name them with the right suffix and use an LODGroup

avatar image pmerilainen Bunny83 · Jul 11, 2019 at 10:59 AM 0
Share

Yes I am aware of that. I am using procedural bezier patches in my own terrain system (allows overhangs and stuff) so I decided to incorporate custom LOD system for it. It would be trivial to create LOD versions of the patches on the fly but it wastes quite a lot of memory (bez patches have relatively high triangle counts) so I think I will not use any polygon reduction LODs.

For static objects like cliffs the builtin LOD system works well though.

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

127 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 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 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 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 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 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Ways of modificating mesh triangles 3 Answers

Differentiate an overlapping collision from just touching 1 Answer

mesh into smaller triangles 0 Answers

instanced mesh won't collide with raycast anymore 1 Answer

Procedural mesh creation issue 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