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
1
Question by Fattie · Oct 31, 2012 at 11:32 AM · meshcombineoptimisation

On combining two objects to reduce draw calls ...

Imagine you have two objects. Say, two different green sheds.

1 2 3 - They already use the same, identical, material. They are physically near each other. They never move or twist in relation to each other.

You think to yourself, "I'll go combine the meshes for optimisation."

In these circumstances, IS IT ALWAYS a good idea to manually remake it as one mesh? ie, to combine the meshes?

I guess I've always assumed the answer is yes. But ..? Any downsides to manually combining meshes in the example?

Note -- assume target is mobile, so probably just plain old Vertex Lit. If you are using fancy lighting, there is a gotchya described here ... RenderTech-ForwardRendering.html ... where it can be better to use mesh of smaller physical extent. Ignore that issue. In this question I mean only in ordinary, single-light situations.

Note 2 -- in the art of culling (whether camera, or occlusion) the shapes of your objects can be critical. I'm not referring to that issue here.

So in a sentence ...........

Is there ANY REASON AT ALL to not combine mesh (manually I mean), where you can?

So for example .....for all I know, the renderer prefers mesh of a certain size (just a wild example...) or maybe there is a difference on mobile, something relating to a shader or fog .. some aspect of rendering .. who knows?

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 whydoidoit · Nov 02, 2012 at 03:53 PM 1
Share

The only things I would imagine would be a problem are:

  • the creation of an atlas that was wasteful - but I guess you say they are using the same material so that won't be a problem...

  • The inability to cull one or more of the objects because they would normally be occluded

avatar image Fattie · Nov 02, 2012 at 04:02 PM 0
Share

Awesome -- thanks. It would appear that 4 out of 4 thinkers agree on this issue.

That has to be good enough for software engineering. Time for beer and $$anonymous$$iPads! :) Cheers!

3 Replies

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

Answer by liszto · Oct 31, 2012 at 11:00 PM

Yes I think you could do it. I do this by script in one of my project on an entire land cause this slice the draw call drastically if lot of separate static mesh use the same material/texture. The only way you mustn't is if your meshes are really large or if they are push them apart. In this second case, the engine gonna compute triangles which are not in the screen because for him it's the same mesh.

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 Fattie · Nov 01, 2012 at 03:38 PM 0
Share

O$$anonymous$$ .. so you agree it's best and there's no real reason not to do it. So so far nobody has a reason not to do it ! :)

Just TBC ... in your example ... you say you do it on an entire "land"

Did you mean the "ground", "surface" ... in fact, just as you say, you probably would not have one mesh for a very large object If you mean the "ground" you probably would not do that right?

Indeed: say a racing game or similar. If you have a very large ground, say 10 hectares. Indeed, you would CUT IT UP, you generally cut up large terrains in to smaller pieces. You might have say 20 or 30 pieces, not one huge champs of 10 ha.

But i guess you just meant in your "whole project" right? (The whole imaginary world.) So for example what sort of things did you combine?

So, you combined two small buildings and so on ... right?

Again ... I don't think there's any reason NOT to do this.

(Other than one's occlusion strategy - I set aside that issue here.)

avatar image
1

Answer by TurboHermit · Oct 31, 2012 at 12:42 PM

If you never use them separately... Ever, then I don't see a reason why you shouldn't. The only downside I can think of is that your texture will expand in dimensions, but if you use the same material with different uv, that is not a problem at all.

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 liszto · Nov 01, 2012 at 03:29 PM 1
Share

I know ^^ I just promote them or post them in answer state when I'm sure it's a good answer ^^

avatar image
1

Answer by flaviusxvii · Nov 01, 2012 at 03:37 PM

You could contrive a scenario where the camera will frequently only see one of them at a time. In that case it makes sense to keep them separate, because the engine would be able to cull the shed that isn't in view.

Other wise it would end up processing the geometry for the hidden shed no matter what, until it knew it could discard the fragments.

But like I said, that's a contrived case.

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 Fattie · Nov 01, 2012 at 03:40 PM 0
Share

Right -- exactly a good example. As I mention in the question, regarding CULLING you may sometimes want things to be separate, for specific culling reasons ... whether frustrum culling or occlusion culling.

But setting aside that issue ... is there some other gotchya? Example .....For all I know, the renderer prefers mesh of a certain size (who knows, just a wild example...) $$anonymous$$aybe there is a difference on mobile, something depending on shader .. who knows?

So far, 3 of 3 say it's never an issue :)

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

13 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

Related Questions

Combining spatially separate meshes? 2 Answers

Optimizing multiple objects by combining meshes 0 Answers

Editing Terrain Topology at Runtime 0 Answers

Combining Meshes, mesh combine a simple working example 1 Answer

Many meshes with different color performance 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