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 hulahoolgames · Jun 13, 2015 at 01:46 PM · spritebatchingstatic batching

Does Static batching on 2D sprites work with random color tone?

Hello, I am not too familiar with static batching in unity. My understanding is, if the gameobjects with 2D sprites are marked as static meaning they dont move, scale or rotate in game unity will use static batching. Given these settings, is static batching used only on gameobjects with same sprites? Also, all these gameobjects have a script attached to them that chooses a random color among list of colors and applies that color to the sprite on their respective Awake functions. Will this break static batching? Please help with any understanding of static batching. Thanks for your responses in advance.

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 hulahoolgames · Jun 23, 2015 at 11:22 AM 0
Share

Hello, I answered my own question by testing it out. Changing sprites color at runtime creates an instance of the shared material for the particular sprite and DOES break batching.

avatar image blizzy · Jun 23, 2015 at 11:36 AM 1
Share

It might be possible to get batching for these back if you use a shader that has the color property as a per-renderer property. In that case, it shouldn't be necessary to clone the material for each sprite that uses a different color.

I haven't tested that, though.

avatar image hulahoolgames · Jun 25, 2015 at 08:33 AM 0
Share

Will surely try it out and get back when I get a chance. Thanks for the reply. I briefly read about the pre-renderer properties on Unity Docs and seems like it does what you say and should work. Thanks once again.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by djarcas · Oct 12, 2015 at 02:19 PM

You can use a material property block to alter the colour of the sprites without causing an instance of the material to occur.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Is it possible to implement Batching directly? 1 Answer

Explain me please this behavior of batching static objects. [Video included] 2 Answers

More than one static batch root? 1 Answer

Custom Sprite Renderer - Batching 0 Answers

Static batching, larger or smaller parts? 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