• 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
6
Question by Jessy · Jan 07, 2010 at 07:48 PM · shaderiphonebatchingcustom-shader

What, exactly, in a shader, stops batching from happening?

I've seen here that batching doesn't always happen. However, I don't think it is tied to alpha blending, as given by evidence here. Is it simply a matter of not using the Geometry queue, or what?

Edit: It's not that, according to the numbers on-screen. I'm clueless, and I haven't witnessed the problem yet myself, but I certainly want to take precautions to avoid it.

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

2 Replies

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

Answer by ReJ · May 24, 2010 at 01:21 PM

I explained some of the batching details in my iPhone Optimization talk at Unite 2009.

You can watch video here: http://unity3d.com/support/resources/unite-presentations/optimizing-for-unity-iphone-1.5

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 Jessy · May 25, 2010 at 01:12 PM 0
Share

I believe from watching the numbers myself over the past few months, and listening to what you said, that it has to do with inserting transparent objects with one material in between transparent objects with another material. Using the same material on as many objects as possible seems to really help out here (they're primarily flat quads).

avatar image
2

Answer by Jaap Kreijkamp · Jan 10, 2010 at 12:01 PM

Lights seem to ruin batching, even if the gameobjects use a material that doesn't use lighting. One light is ok, but if you have two or more the amount of batching is reduced fast. Luckily lights that are completely out of range don't matter. To have some useless stats:

Test scene with floor plane and 35 equal prefabs, (about half of them visible):

  • No lights: 2 draw calls, 18 batched
  • 1 light: 3 draw calls, 18 batched
  • 2 lights: 12 draw calls, 11 batched (numbers depend on light positions)
  • 3 lights: 15 draw calls, 6 batched.
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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Why do Zwrite, Ztest, and Colormask simplifications not optimize shader performance? 3 Answers

What shader blending modes don't work on iOS? 1 Answer

Toon Shader for the iPhone 1 Answer

Batching draw calls changes shadows? 0 Answers

Problem with texture blending and vertex color shader for iOS 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