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 - disable frustum culling gizmos with preview camera #51092

Merged
merged 1 commit into from
Jul 31, 2021

Conversation

lawnjelly
Copy link
Member

When using the preview camera feature it turns out as well as culling the game objects, this also culls the editor gizmos from the preview camera, which makes the editor hard to use in this mode.

To get around this problem we simply disable frustum culling for GLOBAL portal_mode objects when in preview camera mode. This could be a bit slower in an editor scene with lots of gizmos but is the simplest way of solving the problem.

Fixes #50999

Notes

  • This could be done more efficiently by marking the gizmos as debug somehow in the VisualServer, and culling the gizmos from the main camera, and other items from the preview camera. However, this would make the code required more complex, and I'm not convinced it is necessary for this use.
  • If we have reports of a slowdown using the preview_camera and large scenes with lots of gizmos we could make the effort to do the above approach. But it seems unlikely.

When using the preview camera feature it turns out as well as culling the game objects, this also culls the editor gizmos from the preview camera, which makes the editor hard to use in this mode.

To get around this problem we simply disable frustum culling for GLOBAL portal_mode objects when in preview camera mode. This could be a bit slower in an editor scene with lots of gizmos but is the simplest way of solving the problem.
@lawnjelly lawnjelly requested a review from a team as a code owner July 31, 2021 07:04
@akien-mga akien-mga merged commit 3875cda into godotengine:3.x Jul 31, 2021
@akien-mga
Copy link
Member

Thanks!

@lawnjelly lawnjelly deleted the portals_preview_globals branch July 31, 2021 09:03
@Calinou Calinou added this to the 3.4 milestone Jul 31, 2021
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.

3 participants