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 Reverend-Speed · Mar 04, 2013 at 08:45 PM · dynamicbatchingmeshescombineoptimisation

Does anybody know a definitive guide on combining models for batching?

Scripts, sharing materials, etc. What are the absolute best practices? Does anybody know how the fantastic Madfinger handles this?

(Given that I've already studied the following: http://blogs.unity3d.com/2012/03/23/shadowgun-optimizing-for-mobile-sample-level/)

Follow-up: Any definitive documentation or experience on how dynamic batching works? I'm a little confused.

All the best,

--Rev

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

Answer by robertbu · Mar 04, 2013 at 11:00 PM

I don't know of a definitive documentation for dynamic batching, but if you Google this list with "Dynamic Batching," you will get 1000's of hits. An hour of reading will give you a pretty good idea of what works and what doesn't. Here are the high points I've gleamed:

Won't work:

  • If the materials are different, the objects do not batch.

  • If you change any material attribute at runtime (color, texture, offset...), then the object gets a new instance of the material, and that object will no longer batch with the objects using the original material.

  • If you have more than 900 vertex attributes in your mesh, then the mesh won't batch. For example if you are using both normals and uv in a mesh, then you can only have 450 vertices and have the object batch.

  • Submeshes that use different materials don't batch together. Different material means different GPU call.

  • If you use Graphics.DrawMesh() to draw your mesh directly, the meshes don't batch (even if they would batch if attached to a game object).

  • Sometimes objects that on paper should batch don't for reasons unknown (or at least uncommented upon) to the list.

Will work:

  • You can change UV mappings at runtime without breaking batching.

  • You can change the vertex colors at runtime without breaking batching.

  • You can change the mesh itself at runtime without breaking batching (assuming you stay under the vertex limit).

One best practice: look into texture atlases to reduce draw calls.

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 Reverend-Speed · Aug 03, 2013 at 07:48 PM 0
Share

Outrageously late thank you for a really useful answer. Not sure how I missed that this was answered...! Looking forward to playing around with the vertex colours... Cheers! --Rev

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

10 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

Related Questions

Need theory advice on dynamic batching versus combining meshes. 0 Answers

Combine Meshes Utility doesn't work with renderer.material.color. 0 Answers

Dynamic Batching not Batching everything 0 Answers

StaticBatchingUtility combine meshes in runtime 1 Answer

Do Dynamic Batching before Light pass. 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