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 Bonobo · Sep 13, 2013 at 09:27 AM · cullinggpucpustatic-batching

Can static batching prevent frustum culling?

I am optimizing an iOS project.

In one scene there is a large amount of static batching which combines meshes on opposite sides of the level. At any given position in the level, many of these meshes would be outside the camera's FoV if they were all kept separate.

The CPU is processing in good time, however, the GPU typically takes twice as long to process. Most of this time extra GPU time is spent in Camera.Render->Drawing->Render.OpaqueGeometry.

Is it possible that the static batching (which reduces the number of draw calls in the CPU) is preventing frustum culling and causing the GPU to do more work? I think that this may be the case if meshes which would ordinarily be out of the camera's FoV are combined into a single mesh which is visible to the camera from anywhere in the level.

As a corollary question, does static batching have any benefits for the GPU, or does it only help the CPU by reducing the number of draw calls?

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
1

Answer by Bonobo · Sep 16, 2013 at 12:06 PM

I was reading through the documentation and found the following paragraph which seems to say that static batching does not intefere with culling.

http://docs.unity3d.com/Documentation/ScriptReference/StaticBatchingUtility.html "By calling one of the Combine methods you will create an internal mesh which will contain combined geometry, however each original GameObject will be present in the scene and will be culled individually. The fact that GameObjects can be culled individually allows run-time to render the same amount of geometry as it would without batching, unlike combining geometry in the modeling tool. Combining geometry in the modeling tool prevents efficient culling and results in much higher amount of geometry being rendered."

However, I have used occlusion culling in the same scene, and the results strongly suggest that static batching is preventing occlusion culling. This because the amount of draw calls does not change even after I have baked the occlusion culling.

I believe, but I am unsure, that the documentation is only referring to frustum culling when it says "however each original GameObject will be present in the scene and will be culled individually".

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 Louis-N-D · Feb 27, 2015 at 04:28 PM 0
Share

Well, you can't check your draw calls to know if culling is working along with batching. For example, let's consider a "best case" scenario in which you have a scene with 100 objects that all share a material.

Without batching: 100 draw calls if all objects are visible. Or 50 draw calls if half of them are visible. Ok, culling is working!

With batching: 1 draw call if all objects are visible. Or 1 draw call if half are visible. Or 1 draw call if any portion is visible. With the objects batched together, you'll always have 1 draw call for all of them . (assu$$anonymous$$g the shader used only requires one draw call etc.)

It is my understanding that along with the usual geometry info, the batched version of the geometry also encodes an object index for each vertex allowing the culling system to turn off portions of the batched mesh to match the original, separate, meshes from which the batch was made.

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

15 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

Related Questions

Multi-Core CPU use + GPU use and such 0 Answers

High CPU GPU usage not showing in profiler 0 Answers

What are the differences between Progressive GPU and Progressive CPU lightmapping? 0 Answers

GPU GC1000 supported ? 0 Answers

Using the GPU instead of multiple threads 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