Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Ripaaur · Jan 14, 2020 at 03:06 PM · occlusionocclusion culling

Occlusion Culling still rendering hidden gameobjects.

Hello, I'm trying to learn C# coding and Unity so I'm having fun and recreating some of the mechanics from Minecraft.


Image


I'm trying to get some Occlusion Culling working properly so I can boost performance and FPS. However, even tho I am only viewing a small portion of game objects (blocks) it still renders A LOT of blocks that aren't even visible. I would prefer it to simply hide any blocks that are not visible at all and only render ones the player can see (if a block is hidden behind 1 block that is visible, I would like that hidden block to not render.)


I've tried messing around with the OC Bake parameters but nothing seems to change and I don't fully understand what they do. I'm a big newb and still learning so any help would be appreciated. Thanks!


EDIT: I should have probably mentioned I already set all my blocks in the static drop-down to "Occluder" and "Occludee". And these blocks are generated at runtime not in pre-scene, therefore I baked 1 block beforehand to get occlusion culling working in the first place. Also my blocks are made of 6 quads, not primitive cubes or a custom script-made mesh.

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
0

Answer by RendrWyre · Jan 14, 2020 at 04:12 PM

You don't really provide any information so I'm going to take a stab in the dark.


1) Unity needs to know if an object is an "Occludee Static" or an "Occluder Static". For example, any blocks that could potentially occlude another block should be marked as an "Occluder" and, subsequently, any blocks that could potentially be occluded by another block need to be marked as "Occludee".


Marking all of your blocks as both "Occluder" and "Occludee" should solve your issue.


2) For performance reasons I would suggest looking into GPU instancing. For example, the material used for each block should be marked as "GPU Instance" (this means the blocks can not be marked as "Batching Static").


https://docs.unity3d.com/Manual/GPUInstancing.html


3) https://docs.unity3d.com/Manual/OcclusionCulling.html is the best place to understand what is happening. For example


Smallest Occluder - The size of the smallest object that will be used to hide other objects when doing occlusion culling.


So if you're smallest block is 1 meter x 1 meter, your smallest occluder needs to be set appropriately.


I don't know if this will suit your problem 100% depending on what you are trying to do (are you generating and destroying blocks at runtime?).

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 Ripaaur · Jan 14, 2020 at 04:46 PM 0
Share

Apologies, I should have explained or given more information. The picture shown is result of "Occluder" and "Occludee" already being set. (I have everything turned off in static drop-down except those 2).

As I said I have default parameters, so Smallest Occluder is set to 0.25. I'm guessing for a 1x1 cube, the correct setting would be 1 ins$$anonymous$$d of 0.25?

And yes, the blocks are generated at runtime.

$$anonymous$$y blocks are made of 6 quads and then prefabbed ins$$anonymous$$d of the primitive cube or a script-made mesh. This is my lazy way of adding multiple textures to a cube without UV mapping. I've made sure the parent gameobject and all the children (quads) have the Occluder and Occludee set on them, but could the way I've made my cubes be effecting the occlusion results here?

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

118 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 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 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 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 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 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 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

How can I use the Occlusion Culling in a huge 3D model??? 1 Answer

Occlusion culling water reflections 0 Answers

Occlusion Area - Increase Distance Culling 1 Answer

Does mobile GPU perform shape occlusion culling? 0 Answers

Detecting if object is Umbra culled 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