Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 Dex7er · Jul 25, 2014 at 09:30 PM · doorocclusion cullingportal

How does Occlusion Culling work with a Occlusion Portal on a door between two areas?

I'm trying to do a rather simple thing, close off two areas from one another with a door that is bound to a Trigger which opens it when getting close so I can save some draw calls.

The Trigger on the ground calls an animation "Open Door" (which opens the door) while the player collides with it and "Close Door" when he gets out of it.

Closed Door: alt text

Unfortunately the Occlusion Bake takes place while the door is closed and I have no idea how exactly Occlusion Portals work and can't find a guide anywhere.

What I want to do is make Unity show the room on the other side of the door when I step on the trigger and the door starts opening, not only when I step into the next room, at the moment it looks like this when opening the door and the rest of the room starts loading after I've stepped through:

alt text

Same with the other way around, nothing loads till I step through:

alt text

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 Dex7er · Aug 04, 2014 at 03:51 PM

I had managed to find out how this seems to work by the way by not turning the doors into Occluders and putting a cube somewhat larger than the doors right behind them with the Box Collider and Mesh Renderer disabled, but an "Occlusion Portal" added to it as a Component. (Default being "Open" not ticked)

In my Door Trigger Script I added:

 public Animator DoorAnim;
 public OcclusionPortal OccluBox;
 
 void OnTriggerEnter (Collider obj){
    DoorAnim.SetBool ("Open", true);
    OccluBox.open = true;
 }
 
 void OnTriggerExit (Collider obj){
    DoorAnim.SetBool ("Open", false);
    OccluBox.open = false;
 }

Bound them to the right GameObjects and this worked, but not exactly to my satisfaction since upon exiting the Trigger area the Occlusion Portal would close and things would start disappearing on the other side, so I added:

 void OpenOcclusionPortal() {
     OccluBox.open = true;
 }
 
 void CloseOcclusionPortal() {
     OccluBox.open = false;
 }


to the Beginning of my DoorOpenAnimation and the End of my DoorCloseAnimation as Event functions.

It might seem trivial, but since it doesn't seem to be explained anywhere how it works I thought this might help someone. alt text

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 Ratboy601 · Oct 06, 2015 at 01:25 PM 0
Share

Interesting. I was under the impression that the "open" boolean value only meant it was exposed to scripting, not literally whether or not it was actively occluding at the time (similar to Source engine Area Portals). Thats what I was HOPING they do, and now I must try this. I'm surprised there's not more documentation in Unity for such a useful optimization tool...

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Occlusion Portal: Invalid Portal index 1 Answer

How do Occlusion Portals work in Unity 4.3 1 Answer

How to pick up battery to open door? 2 Answers

Calculating Door Hinge Pivots 2 Answers

Script for a door that requires (9 papers) to open 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