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
0
Question by Richard J. Hansen · Apr 27, 2011 at 06:02 AM · dynamiccullingocclusion

Occlusion culling in levels generated at runtime

I'm creating a FPS maze game where the maze is generated pseudo randomly at runtime.

I would like to take advantage of occlusion culling as the number of draw calls can become very large as the maze size grows.

Now obviously I can't bake at runtime, but I was hoping to get some input on alternatives (if not to use occlusion culling, to at least achieve a similar affect).

The following are the ideas that I had to reduce draw calls (though I do not know if they would slow things down with the overhead they would add).

1) Add a fog affect to limit view distance, a sphere could be used to turn off the mesh renders of any object outside the sphere and turn any objects on inside the sphere. It would not be as good as real occlusion culling, but it would restrict the range at which the engine was drawing unnecessary objects.

2) Merge meshes into very large meshes but break them up into smaller chunks when the player gets near for better lighting effects. When the player passes away they can remerge.

I don't know if anyone has tried anything like either of these ideas, or if they have any other solutions. Any input would be appreciated.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by aeroson · Sep 01, 2014 at 11:31 AM

Doom 3 based occlusion areas and portals might be the perfect solution for procedural mazes.

I was unable to find any such C#/Unity variations of it.

Edit: Here is my implementation, it has very simple ConvexPolygon (idWinding) and Area classes.

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
avatar image
0

Answer by Eric5h5 · Apr 27, 2011 at 07:51 AM

My game Realmaze3D generates meshes at runtime, where the meshes are broken into sections made of 4x4 squares. (That can actually be set to arbitrary numbers, but 4x4 seemed like a good balance; a normal-sized maze has about 60 pieces total.) Whenever the player turns or moves, the game scans the maze array from the player's position and turns on the pieces that should be visible. Essentially it's a primitive form of real-time occlusion culling, but it's very fast and typically results in only a few draw calls at any given time.

Your first idea is superfluous, since Unity's frustum culling already does this. If you just set the camera's far clip plane to the point where the fog becomes 100% opaque, then you don't have to do anything else.

Your second idea is sort of what I did, minus the merging/breaking/remerging part. Frankly there's not much point doing that, since you can't generally see very far in a maze, so you might as well leave the chunks separate. Just a relatively basic visibility routine like I used is fine.

Comment
Add comment · Show 2 · 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 Richard J. Hansen · Apr 27, 2011 at 02:48 PM 0
Share

The point of the second idea was that you couldn't see far. By combining them I would hope to reduce the number of draw calls. As for the second idea I had not realized that fulstrum culling also deals with distance (though I really should have).

I guess I'm not completly clear about what you did. You said it was like my second idea $$anonymous$$us the breaking merging, but there isn't much to the idea beyond that. Are you just saying that you broke/merged things at generation.

The array thing seems like it could work for me. Of course the issue is co$$anonymous$$g up with the algorithim to run through it.

avatar image Eric5h5 · Apr 27, 2011 at 09:11 PM 0
Share

What I mean is that each 4x4 section of the maze is a separate mesh. If the maze was a single floor that was 8x8 squares in size, then there would be a total of 4 meshes. The visibility routine "looks" down hallways and turns meshes on as appropriate.

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

1 Person is following this question.

avatar image

Related Questions

Dynamic moving occluder? 0 Answers

Dynamic loading of occlusion culling, possible? 0 Answers

Occlusion Culling Question 1 Answer

How would I partially hide an object like a sphere if part of it falls behind or below a plane/object? 0 Answers

creating custom occlusion culling? 2 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