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
2
Question by Slight0 · Oct 20, 2014 at 09:38 PM · meshoptimizationprocedural meshefficiency

So what's Mesh.UploadMeshData do exactly?

I'm generating a mesh from code. Once I create the mesh it does not get modified; only destroyed and replaced. Should I be calling this function after creating the mesh?

What does it do exactly? Does it immediately upload the data from the RAM to VRAM? Does it clear RAM buffers so as to not waste memory? Isn't this done automatically?

Try to avoid pure speculation, thanks.

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

3 Replies

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

Answer by Slight0 · Oct 22, 2014 at 10:11 PM

A dev responded to my forum thread.

His response:

it looks like a documentation bug! Thanks for pointing that out.

It copies the mesh to the GPU memory and frees it from the main memory. Therefore, you will not be able to modify it once it's "uploaded".

[...]

It will only free main memory it occupies if you pass in "true".

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
2

Answer by Graham-Dunnett · Oct 21, 2014 at 12:34 PM

http://forum.unity3d.com/threads/can-a-dev-explain-what-mesh-uploadmeshdata-does.275106/

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 Slight0 · Oct 22, 2014 at 10:09 PM 0
Share

Please don't link me to my own thread so that you can get credit for the answer. That's just low. (Unless you were the person in the thread who answered me)

avatar image Bunny83 · Oct 23, 2014 at 12:21 AM 0
Share

@Slight0: Well you crosslinked this question in the forum thread but you didn't link the forum thread here in your question. So it's quite normal to add the crosslink. Also accepting your own answer won't give you any karma ;)

avatar image Slight0 · Oct 23, 2014 at 07:09 AM 0
Share

@Graham Dunnet Yes, but I did the work, so why should you get any credit? Not just that, but I was planning on updating this answer once the forum thread got a response. It had only been a day...

$$anonymous$$y answer also includes the devs response so people don't need to follow some link and parse the thread.

avatar image
1

Answer by Bunny83 · Oct 20, 2014 at 10:02 PM

There's no way around pure speculation. Even UploadMeshData has already a doc page (however with a typo in the parameter name), it doesn't have any description and isn't listed in the docs.

It might be an internal method and might be removed or it might become a documented method in the future. Until then we can just guess what exactly it does. Sometimes a Unity staff member explains some internal stuff in the forum, so you might ask the question there. If you have the time to do some benchmarking / testing feel free to try it out.

As for the clearing of the RAM Unity most likely will keep the mesh data in the RAM, even when it got uploaded to the VRAM. The parameter of "UploadMeshData" suggests that when you pass true to markNoLongerReadable might actually clear the RAM, but again that's all speculation since we simply don't know (yet).

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 Slight0 · Oct 20, 2014 at 10:08 PM 0
Share

I figured someone with inside knowledge might find this question. Like someone who heard it from a dev or someone with full unity source access.

I'll give the forums a shot.

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

29 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

Related Questions

Accessing mesh vertices is extremely inefficient; any workarounds? 0 Answers

Efficient mesh vertex count changes? 1 Answer

Sharing vertex buffer between mesh objects 1 Answer

Procedural Mesh Editing Performance 1 Answer

Set vertex positions aligned to a grid 2 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