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
2
Question by Gamejie · Mar 18, 2012 at 04:59 AM · optimizationmaterialsdraw calls

Share material to reduce draw calls

Hi everyone,

I am trying to find a way to reduce my draw calls. Here is the situatio: I instantiate a lot of objects, but not a lot of different objects. So the point is that a lot of objects share the same material. Unfortunately, each object is using 1 draw, which, at the end, means a lot of draw calls. I would be very glad if someone can find a solution like a maguc code, or a trick like instantiate in a game object and combine the materials...

Thanks a lot in advance Cheers

Comment
Add comment · Show 2
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 asafsitner · Mar 18, 2012 at 09:37 AM 0
Share

Due to the fact that Unity doesn't support instancing, every object will take a draw call no matter what material is assigned.

However, Unity already shares materials between objects, so if you have two objects using the same material, they will share it. If you make a change to one object's material, though, Unity will create a copy of that material, so if you want to change the material for all objects use the `Renderer.shared$$anonymous$$aterial` property.

Take a look at static batching as well.

avatar image Gamejie · Mar 18, 2012 at 12:09 PM 0
Share

every object will take a draw call

Aoutch. Ok, thaks for the answer. I will have a look at your link. Thanks, have a nice week end

3 Replies

· Add your reply
  • Sort: 
avatar image
5

Answer by CHPedersen · Mar 18, 2012 at 11:11 AM

Sharing materials saves the overhead of having to store the same texture more than once, in case multiple objects use the same one, but, as I'm sure you've noticed, it does not necessarily reduce the draw calls.

To do that, notice that you can combine meshes using the method CombineMeshes, see here:

http://unity3d.com/support/documentation/ScriptReference/Mesh.CombineMeshes.html

In general, it's a good idea to do this for all objects that share the same material, and which do not need to move independently. It enables the engine to render them all with a single draw call rather than one call per object, and thus accomplishes what you want - a reduction to draw calls.

For more in depth information on this, see this question, which deals with the same problem:

http://answers.unity3d.com/questions/14578/whats-the-best-way-to-reduce-draw-calls.html

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 Gamejie · Mar 18, 2012 at 11:24 AM 0
Share

Very good link, it will allow me to have better art with the same performances.

Thank you both

avatar image Steven-1 · Mar 18, 2012 at 12:14 PM 0
Share

you might want to keep in $$anonymous$$d though that combining objects that are far away from each other will cause occlusion and frustrum culling to be less effective (though that's generally not such a big issue). $$anonymous$$ore importantly though the memory used will increase severly due to there beeing more and larger unique meshes

avatar image
5

Answer by Nabeel Saleem · Nov 24, 2014 at 11:19 AM

Reducing draw calls are big challenge for almost every indie game developer but by using this simple and free plugin by pudyjo you can reduce massive numbers of draw calls its amazing and free.
you can see this tutorial he reduce big numbers draw calls- TUTORIAL

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 MoliCat · Nov 24, 2014 at 11:32 AM 3
Share

Yeah its great plugin i have it :)

avatar image
0

Answer by tra · Sep 18, 2013 at 09:49 AM

If you use NGUI and You want to use NGUI Atlas on 3D meshes you can get Atlas3D plugin for NGUI. Check the video and tutoraial at: http://tracki.pl/atlas3d
If you use low poly meshes (not more than 300 vertices) you can get 1 drawcall with many dynamic meshes. Additionally script helps with converting Unity lightmapping and you still get 1 drawcall when using lightmapping on those dynamic meshes. Just like static batching on Unity Pro but you have dynamic meshes free to move and ready for occlusion.

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

7 People are following this question.

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

Related Questions

Number of materials on a model 2 Answers

Dynamic batching 6 Answers

Draw call depending of sorting Order of SpriteRedenderer(2D) 2 Answers

SetPass calls - important to keep this number low? 5 Answers

The best way to have multiple models with only one material 2 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