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 samcheng198 · Aug 21, 2018 at 11:22 AM · meshstreamingmeshfilterserializeserializedobject

3d mesh serialize

Hi all,

I'm currently doing a project where we stream 3d model from another place.

Right now I'm planning to serialize the 3d mesh to send it over with the technique below http://wiki.unity3d.com/index.php/MeshSerializer basically writing all the vertex, normal and triangle information in to the data file.

However this only works with a vertex and triangle count less than 65535 (shown in the code). Can someone explain to why is this?, and is there a way to store more than 65535 vertex.

Will it be better to just send over a obj or fbx file and import them real time?

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 Bunny83 · Aug 21, 2018 at 11:59 AM 0
Share

To answer your last question: No. Unity doesn't support any dynamic model loading at runtime besides assetbundles. So to import obj or fbx files you need a custom importer that works at runtime. If you already have the mesh imported in Unity's $$anonymous$$esh format it would be better to either use AssetBundles or serialize the mesh yourself.

1 Reply

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

Answer by Bunny83 · Aug 21, 2018 at 11:56 AM

Well in the past Unity has a fix index size of 16bit. This only allowed to index 65535 vertices. However Unity now allows you to change the index buffer format of a mesh. So when using a 32 bit index buffer it supports up to 4 billion vertices. The mesh serializer on the wiki is quite old and only supports rudimentary informations. A Mesh could have several submeshes, different mesh topologies per submesh. Also the vertex data could also contain several uv channels or vertex colors.


I've written a general purpose mesh serializer some time ago. It should be able to serialize any kind of mesh (including skinning information and blendshapes). However at the time i wrote it the 32 bit index buffer support wasn't a thing yet. Though the serializer doesn't care about how many vertices the mesh has. You probably need to set the index buffer format explicitly before deserializing if the mesh has more than 64k vertices.


If i find the time I'll add this small change to the deserializer. The Mesh class now also supports up to 8 uv channels while in the past it only supported 4. So that's another thing that need to be adjusted to guarantee that every mesh can be serialized / deserialized.

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 Fangh · Apr 08, 2020 at 10:30 AM 0
Share

It works well. Thank you !

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

102 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

Related Questions

Serialize a mesh 1 Answer

Assigning SharedMesh is creating an unreferenced instance 0 Answers

Send a mesh filter data(640kb) via PUN/UNET/Any network continously 1 Answer

How to prevent editor to set the scene dirty if a script changes a mesh (@ExecuteInEditMode) 1 Answer

Generate a highpoly sphere with mesh collider procedurally 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