Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement portal culling #150

Open
3 tasks
fallenoak opened this issue Jun 7, 2016 · 1 comment
Open
3 tasks

Implement portal culling #150

fallenoak opened this issue Jun 7, 2016 · 1 comment

Comments

@fallenoak
Copy link
Member

fallenoak commented Jun 7, 2016

WMOs can be a real drag on performance, mostly because of draw calls and object projections stemming from their (at times hefty) doodad sets. We should implement portal culling using the portal data baked in to the WMO files. This also benefits rendering performance when inside a WMO such that the overworld is no longer visible.

Progress

  • Create WMOPortal class
    Portal culling will require some helper functions to project a frustum out of a given portal, as well as intersect that frustum with other portals. To keep the traversal function as clean as possible, we should create a class to abstract away some of this portal logic.
  • Extend WorldRenderer with culling functions
    We'll want to start the culling operation from the camera's current location relative to culling structures. If the camera is in the overworld, culling should begin at all exterior-flagged WMOGroups, and progress from there. If the camera is inside a specific WMOGroup, culling should begin in that group, and progress through all visible portals within that group.
  • Locate the camera in either the overworld or specific WMOs / WMOGroups
    We can probably use the BSP tree baked in to the files for this.

Details

  • CWorldView::s_portalMaxDepth = 12
    • seems to be the maximum levels of recursion allowed before portal traversal halts
@timkurvers
Copy link
Member

Sounds great! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants