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 Griffo · Jul 15, 2012 at 07:00 PM · staticbatchingdrawcalls

Static Batching HELP!!

Hi, Can someone please tell me why static batching seem not be working properly, I have 4 barrels and 4 boxes all share the same texture, so I thought that with the below screen shot the Draw Call should be 14 not 19 as in the picture, as the one with nothing in screen shows 12 Draw Call's.

If I put the 4 barrels on screen alone the Draw Call is 13 as I'd expect, same if I put the 4 boxes on screen alone, and 15 Draw Calls if I but the 4 barrels and 4 boxes on screen.

I'm confused ??

They all share Mobile/VertexLit shader, tried with just VertexLit same outcome.

Unity 3.5.2f2 iPhone Pro.

alt text

alt text

grab01.jpg (38.8 kB)
grab02.jpg (47.6 kB)
Comment
Add comment · Show 3
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 ScroodgeM · Jul 15, 2012 at 10:24 PM 0
Share

all objects marked as static?

material instance is the same for all objects? not just shader and texture must match

objects have same scale values?

avatar image Griffo · Jul 16, 2012 at 03:52 PM 0
Share

Yes. Yes. Yes.

avatar image ScroodgeM · Jul 16, 2012 at 06:02 PM 0
Share

just test:

  • instantiate all objects on the screen and move camera VERY far away from current position, but don't lose focus on objects - notice draw calls changes

  • now try don't move camera and change near clip plane of current camera (leaving object farther them near clip plane) - does it affect draw calls?

1 Reply

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

Answer by Griffo · Jul 16, 2012 at 06:34 PM

I put 4 barrels in the scene that was doing 12 Draw Calls and it went to 13, then I added 4 box's along side the 4 barrels and it went to 16.

I then tried you suggestions and the first one no change still 16 Draw Calls, the second one the Draw Calls went back down to 12.

If I put 4 barrels it goes up 1 Draw Call from 12 to 13 If I put 4 boxes it goes up 1 Draw Call from 12 to 13

Then if I put 4 barrels and 4 boxes it goes up 6 Draw Call from 12 to 18, thats with all boxes the same scale and all the barrels the same scale but 0.5 taller than the boxes, should it not go up 2 Draw Calls from 12 to 14, 1 Draw Call for the batched barrels and 1 Draw Call for the Batched boxes ?

Comment
Add comment · Show 2 · 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 ScroodgeM · Jul 16, 2012 at 06:58 PM 0
Share

the main issue in your case i see in z-size precision limit. for batching unity sorts all objects by length from camera, and if some objects are placed very close to each other (by z-position from camera, not in XYZ) unity can fail to sort it and batch fails. changing near clip plane changing z-size precision and changes the situation.

finally i havn't a true solution in your case, just try different combinations of camera position and clip planes - there's should be a combination where z-size will calculate correct and you got a picture you want...

avatar image Griffo · Jul 16, 2012 at 07:45 PM 0
Share

O$$anonymous$$ will try different combinations .. thanks for you input, much appreciated.

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

Static batched objects disappear on OSX player 0 Answers

Creating a field of models...batching? 0 Answers

Static Batching with LOD Meshes/GameObjects & Other Questions 1 Answer

When Static Batching and building, objects checked Static do not appear 1 Answer

Static batching not working (HDRP) 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