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 temptest123 · Oct 08, 2013 at 12:41 PM · occlusion cullingstatic-batching

Static Batching & Occlusion Culling

Let's say I have three nearby static meshes that share the same textures and the same material. I could merge them together into a single mesh in my 3D modeling tool to enforce them being rendered with a single drawcall, but I like the convenience of being able to reposition them individually in Unity3D and as far as I understand it static batching should achieve exactly the same - upon compilation these meshes will be merged together. Is this correct so far?

How will static batching be affected once occlusion culling is introduced (and how will static batching affect occlusion culling?). Will the meshes not be merged together? or will the merging avoid occlusion culling to work (let's assume my whole scene shares the same material)? is it possible to somehow define groups of static meshes that shall be statically batched together, so that they can act as a single occluder/ocludee?

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 Dreamora · Oct 09, 2013 at 10:29 AM

There are a few questions with distinct answers in your question, so please let me answer them piece by piece:

  1. In case you would decide to go without static batching, there are still 2 more productive ways going forward than merging the meshes in your modelling app. Thats the Static Combine Functionality in Unity Pros or the Combine Children script of the 'Scripts' package installed along unity, which both allow you to combine the meshes in Unity

  2. Static batching works along these lines but still different becuase it is not a 'draw all or nothing' scenario. It will draw the distinct meshes if their bounding boxes are within the visible area of your camera (or your main camera in case of OC)

  3. The occlusion culling will work with either setup. To the occlusion culling it does not matter if its 1 mesh or 20 though as it operates on PVS (Potentially Visible Sets) and not the actual geometry once calculated, so you can replace the geometry or even throw it out the game completely if thats what you want to do (it hence makes sense to have simple and complete objects as occluders instead of using over detailed objects which require extremely dense pvs settings that take hours to days to calculate)

  4. Static batching unlike the mesh merges from 1 will respond to occlusion culling properly and on an object to object base. Mesh merging can be extremely tricky (unless its a Quake style games with dedicated rooms and corridors connecting them) to do right when combined with occlusion culling because Unitys occlusion in general is mesh / object based and not triangle based. That means that if the bounding box of your mesh / combined mesh is in the view of the camera and not occluded, then the whole mesh will be rendered even if there is not a single triangle visible at the time. Also desktop graphic cards are incapable of properly handling this situation either, processing the whole invisible mesh and sending it to the gpu - on mobile GPUS from Imagination technology or Qualcomm (but not NVIDIA) all this hidden geometry is discarded in the first step already which reduces the dependence on PVS for this purpose at least (occlussion culling has other powerfull uses related to object activation and deactivation that are important though like animation that can stop updating the skeleton while out of view, a quite costly operation with complex skeletons)

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

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

What can you change for a statically batched mesh? 1 Answer

Occlusion Culling still not running smooth... 1 Answer

relation between VRAM and Camera VertectLit & Deffered 0 Answers

3d Text culled via occlusion culling? 0 Answers

Object is getting culled even though it's not Occluder/Occludee static? 0 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