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 Next Beat Games · Dec 30, 2012 at 07:40 AM · materialitweeninstance

iTween vs GoKit

Hello. I have say 10 instances of a prefab consisting of a box plane (2 triangles). The material points to a texture atlas png file. I have them fading in using iTween's colorto function. The problem with this is that the color tween will create an instance of the material used for each object instead of affecting the sharedMaterial. It doesn't look like there is a solution in iTween. As I looked online for solutions, I came across GoKit. Would GoKit allow me to do this?

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
0

Answer by robertbu · Jan 12, 2013 at 06:40 AM

I don't know about GoKit specifically, but I believe the problem you are facing is inherent in Unity. I've playing with some code that has the user generating up to 1000 of the same game object. If the color/alpha stays the same, then the number of draw calls is just a handful (they are batched). But if I change the color/alpha at all, it appears that each object get's its own cloned copy of the shared material, and Unity will no longer batch the draw calls.

But performance is not as bad as I expected. For 1000 objects each with around 35 triangles, I'm getting 1000+ draw calls and 12 - 14 FPS on the iPad 3. Not great but still usable. Which means that you may be trying to optimize too soon. In addition when I increased the complexity of the game objects to 350 triangles, the frame rate dropped to around 8-10 FPS...sluggish but not what I would have expected from a 10x increase in triangles.

I did run across one possible solution, but I've not run any tests ont it yet. It appears that I can combine meshes and use a materials array and drop the draw calls substantially.

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 Next Beat Games · Jan 22, 2013 at 09:20 PM 0
Share

did you run the tests yet?

avatar image robertbu · Jan 23, 2013 at 04:09 AM 0
Share

No, but I did run a couple of tests with something Vectrosity...a line drawing package that builds a combined mesh. Using an array of 9000 lines, each assigned a random color, iPad 3 performance was 28 - 30 fps (though it varies by shader). A similar test with simple geometry in my code above using separate meshes had 17 fps for only 1000 meshes. So Vectrosity had twice the performance with 9x number of lines and triangles.

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

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Applying an instance of a material to a cube 1 Answer

change toonshader outline colour in script itween 0 Answers

Change material inside instanced prefab, gameobject.renderer is NULL 1 Answer

Finding and replacing all "instanced" materials 2 Answers

Material Cloning Issues 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