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

Portals - show gridmaps using global mode #60851

Merged
merged 1 commit into from
May 7, 2022

Conversation

lawnjelly
Copy link
Member

@lawnjelly lawnjelly commented May 7, 2022

Gridmaps did not previously show at all when portals were active, due to the instances being created defaulting to static mode, and not being converted during the room conversion stage.

This PR sets gridmap instances to global mode, which enables them to show up when portals are active (using frustum culling only, no occlusion).

Fixes #60833
(still needs documentation though)

Notes

The previous state of gridmaps showing was not so much a bug as a conscious decision to deter users from using this combination. However #60833 suggests there may be use cases.

Properly supporting gridmaps would likely either involve:

  1. Writing bespoke conversion code to work with the gridmap
  2. Adding the ability to bake gridmaps to regular SceneTree nodes, so they could be converted as normal

(1) Would probably not be a practical approach for such a special case, so (2) would be far more reasonable.

  • Setting gridmap instances to GLOBAL portal mode is somewhat of a bandaid, but is better than nothing, as it allows them to show up within a portalled scene. However there will be no occlusion culling, and the culling for GLOBAL instances isn't quite as efficient as through the BVH (the BVH is used when portals is not active, but GLOBAL instances just use O(n) culling).
  • One danger here is that users may believe that gridmaps are fully supported with occlusion, which is not the case.

Gridmaps did not previously show at all when portals were active, due to the instances being created defaulting to static mode, and not being converted during the room conversion stage.

This PR sets gridmap instances to global mode, which enables them to show up when portals are active (using frustum culling only, no occlusion).
@lawnjelly lawnjelly requested a review from a team as a code owner May 7, 2022 09:24
@Chaosus Chaosus added this to the 3.x milestone May 7, 2022
@akien-mga akien-mga merged commit 887fcd0 into godotengine:3.x May 7, 2022
@akien-mga
Copy link
Member

Thanks!

@lawnjelly lawnjelly deleted the portals_gridmaps_global branch May 10, 2022 07:07
@akien-mga akien-mga modified the milestones: 3.x, 3.5 May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants