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 Relevate · Jul 22, 2013 at 07:38 PM · optimizationdatadrawcallsoptimizevisualize

What's the best way to optimize draw calls with 100,000+ bjects?

I'm working on a data visualization program with Unity that requires the creation of thousands of objects with their own unique size and color. Each object is a primitive shape such as a cube and is also static.

Right now I'm instantiating a prefab for each object necessary. However, because each object has its own color, these objects will not batch and will render slowly.

Any suggestions for a way to get these objects to batch or perhaps a different approach that doesn't require many game objects?

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 sdgd · Jul 22, 2013 at 07:40 PM 0
Share

suggestion sphere takes less than cube

to get rid of more objects just get 1 obj, ... tho this might not be a solution I don't know what do you need the objects for

avatar image Jamora · Jul 22, 2013 at 07:43 PM 0
Share

Are the objects multi-colored (i.e. textured etc.) or does each only have one color?

avatar image Relevate · Jul 22, 2013 at 08:03 PM 0
Share

Each object has a single color.

1 Reply

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

Answer by Jamora · Jul 22, 2013 at 08:22 PM

You could create a texture atlas that contains a pixel of all the colors you are using. If you have millions of colors to choose from, you might have to create several.

Because you can then assign an atlas to one material, and only different materials cause draw calls, you will effectively cut down the amount of draw calls from the amount of objects to the amount of texture atlases you are using.

For each object, you will just have to choose the right pixel from the atlas and use that as the texture for the object.

The hardest part is creating your atlases so that you can programmatically choose the correct pixel. If you manage to use only one atlas, this shouldn't be a problem.

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 Relevate · Jul 22, 2013 at 08:44 PM 0
Share

This sounds great, I'm going to experiment with it.

I'm also going to look at combining all my meshes and using $$anonymous$$esh.colors for coloring by vertex. How would this method compare to the texture atlas in terms of render speed?

avatar image Jamora · Jul 22, 2013 at 09:27 PM 0
Share

Hard to say. Common sense dictates that the less objects there are to batch, the faster the CPU will handle the batching. Unity offers some tips on graphics optimizing here and here, I hope you find them useful. The latter link is for mobiles mostly, but still applicable on most parts.

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

17 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 avatar image

Related Questions

Is there a way to merge multiple identical animated models? 0 Answers

Power consumption optimization 2 Answers

How performant is performant? 0 Answers

Instantiated object material colors 1 Answer

Does using point lights stop dynamic batching? 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