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
1
Question by bhambhu · Oct 10, 2013 at 07:43 AM · performancebatching

Shader and Dynamic batching problem

my car model has 290 verts and 210 tris . When i use Diffuse shader dynamic batching is happening but when i use legacy/lightmapped/bumped diffuse , dynamic batching is not happening . As mentioned in official doc . 300 or less verts that i require for dynamic batching . So, what's going wrong ??

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 CHPedersen · Oct 10, 2013 at 08:15 AM

Did you see this page on Dynamic Batching?

Study all the points under the "Tips" section and make sure the shader you want to use obeys all of them. For example, something which is bumpmapped will certainly need more data than just Vertex Position, Normal and single UV. It also needs tangent, for instance. In that case, the max vertex count drops to 180 and then your mesh violates the limit.

There is also a note about lightmapped shaders:

"Objects with lightmaps have additional renderer parameter: lightmap index and offset/scale into the lightmap. So generally dynamic lightmapped objects should point to exactly the same lightmap location to be batched."

Does your setup obey this requirement?

Comment
Add comment · Show 4 · 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 bhambhu · Oct 10, 2013 at 08:49 AM 0
Share

thanx @CHPedersen . I used mobile/diffuseBumpedmap , then it in edit option and it gives me list alt text

In highlighted part ..I am guessing that i have 5 Requirement for this shader . Now if i am correct then i need a shader which can fulfill my normal and light map requirements . I don't know the shader program$$anonymous$$g . Can you suggest me some free online shaders which can fulfill my needs ????????

options.png (17.6 kB)
avatar image CHPedersen · Oct 10, 2013 at 09:13 AM 0
Share

Sorry, I can't. :-/ I haven't browsed a lot for bump/light mapped shaders online as my project has pretty weird requirements that require me to write custom shaders myself. But I can tell you that no matter where you look, there is no shader that will give you bumpmapping without using tangent vectors. This is simply because the mathematical solution for bump mapping requires them. So you won't find a shader that will magically give you bump mapping while still bypassing the 180 vertex limit. You will have to either simplify your mesh, choose a non-bumpmapped shader or forego dynamic batching.

As for the last option, do you absolutely need dynamic batching? I'm guessing you're on a mobile platform and are worried about performance, but have you tried to go without it and see what happens to the framerate?

avatar image bhambhu · Oct 10, 2013 at 12:26 PM 0
Share

yes i am developing for mobile platform and concern about draw calls as there are too many objects . Please guide me in following problem also .... For static object i am planning to use unity's inbuild light-mapping .But for moving cars i can't use it and if i use external lightmaps then i need to use legecy/lightmapped/Bumped Diffuse shader as i am using a normal also . And in this case i am loosing dynamic batching . What to do ??

avatar image CHPedersen · Oct 10, 2013 at 12:37 PM 1
Share

If using these shaders is critical to you, then dynamic batching is out of the question. If your performance suffers because of this, you must find another way to optimize the game. It's a tough trade-off, but you cannot have both dynamic batching and normal mapped shaders with >180 vertex objects. You must either choose between your shader or batching, or you must optimize elsewhere to regain what the lack of batching cost 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

16 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

Related Questions

Is there any way I can statically batch procedurally generated objects? 0 Answers

,Drawing 100 000+ cubes 1 Answer

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

Batching on Mobile = Bad? Your experience. 1 Answer

Force elements in same batch 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