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 BenSan · Feb 16, 2016 at 09:02 AM · shaderrenderingvertexbatchingdrawcalls

Dynamic Batching not working even adhering to all rules

Trying to get dynamic batching to work without having to go under 300 verts:

Using Unity 5.3.1f

Already checked these rules:

  • They share the same material

  • Materials not instanced

  • Unity shows the vertex count being under 900

  • Using most simple shader (only a color is output)

  • Forward render mode

  • No Transparency or alpha

  • No light or shadows and switched off all the settings for receiving shadows etc.

  • Scaling is uniform (1,1,1)

  • No layering of objects in the view

  • Not instancing object from code

  • No lightmaps

Both in scene when rendered with material applied (simple shader), and viewing imported mesh in the project view we see the object having:

789 verts and 472tris

The mesh in question has vertex color and a uv applied. Testing has proven that removing either of these reduces the number of verts counted by Unity (to 238 verts) , we assume these are not counted additionally to the 789 verts as they are already included.

Our goal: We would like to be able to batch moving objects with a low polycount with vertex color and a uv applied, dynamic batching is behaving very unpredictable up and till now. If anyone has an idea why this would not work we would be very grateful...

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 BenSan · Feb 18, 2016 at 09:07 AM

The Documentation refered to in the question seems to be wonky:

batching is applied only to meshes containing less than 900 vertex attributes in total.

even though Unity displays the amount of vertex attributes directly in the editor we never got it to batch with anything over 300 vertex attributes. This line does hint that the actual limit might change: "Please note: attribute count limit might be changed in future"

Either Unity does not account for certain attributes when counting the vertex attributes inside the editor or (as of the time of speaking) the documentation is wrong.

Solution:
Testing showed us that dynamic batching has too much overhead for what we need. We now batch all meshes manually and update the combined mesh when something changes which is not all to often.

For this we use the combineMeshes method.

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
0

Answer by nkmxzhang · Feb 18, 2016 at 11:40 AM

  • Batching dynamic objects has certain overhead per vertex, so batching is applied only to meshes containing less than 900 vertex attributes in total.

  • If your shader is using Vertex Position, Normal and single UV, then you can batch up to 300 verts; whereas if your shader is using Vertex Position, Normal, UV0, UV1 and Tangent, then only 180 verts.

dynamic batching vertex limit count = 900 / Shader vertex attribute count

so, if you want to use dynamic batching, please check the shader used.

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 BenSan · Mar 15, 2016 at 03:17 PM 0
Share

I don't entirely understand your calculation on how the limit is defined.

If the amount of vertex-attributes is not allowed to go above 900, then we have (apparently) made sure that it doesn't. I wasn't sure if we were missing something. We checked inside the Editor and it displays the difference when adding and removing vertex colors for instance. So if the editor displays less than 900 we should be okay.

We used the most simple shader possible and it did not batch. The only thing we output or used was a single hardcoded color (the rest was barebone). And that's not a surface shader I might add ;)

avatar image
0

Answer by vfxjex · Aug 06, 2020 at 08:22 PM

In case someone bumps into this concern. Just to make it simple, try to make sure your model is below 300 vertices. Take note we are talking about Unity Vertex Count not the 3D modelling software vertex count. alt text


vertex-count.png (6.0 kB)
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

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

Trouble Understanding Rendering Statistics Window 2 Answers

Is it possible to utilize iphone dynamic batching with "traditional" animated sprite techniques? 1 Answer

Why does the frame debugger say node uses different shader when it isn't? 0 Answers

Drawcalls or Batched, which is more important to performace? 1 Answer

How to know if my Shader Graph is supported by the SRP Batcher? 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