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

Make initialization settings take effect in SubViewport #64138

Conversation

Rindbee
Copy link
Contributor

@Rindbee Rindbee commented Aug 9, 2022

SubViewport has some initialization settings of its own, but these settings are not synchronized to the RenderingServer when initialized, which causes some problems.

Split from #62854.

This is a prerequisite to resolve #55471, still need to modify update_mode manually, or add as a child to SubViewportContainer (update_mode is automatically set to UPDATE_ALWAYS).

Currently, UPDATE_WHEN_VISIBLE has no meaning for SubViewport. Presumably for visible, RenderingServer has different rules, viewport needs to have a visible rect to be considered visible, while SubViewport has only size and no position, so it is not considered visible even if it is set to be an active viewport (RS::viewport_set_active).

`SubViewport` has some initialization settings of its own, but these settings are not synchronized to the `RenderingServer` when initialized, which causes some problems.

Split from godotengine#62854.

This is a prerequisite to resolve godotengine#55471, still need to modify `update_mode` manually, or add as a child to `SubViewportContainer` (`update_mode` is automatically set to `UPDATE_ALWAYS`).

Currently, `UPDATE_WHEN_VISIBLE` has no meaning for `SubViewport`. Presumably for **visible**, `RenderingServer` has different rules, viewport needs to have a visible **rect** to be considered **visible**, while `SubViewport` has only `size` and **no** `position`, so it is not considered **visible** even if it is set to be an active viewport (`RS::viewport_set_active`).
@Rindbee Rindbee requested a review from a team as a code owner August 9, 2022 05:01
@Calinou Calinou added this to the 4.0 milestone Aug 9, 2022
Rindbee added a commit to Rindbee/godot that referenced this pull request Aug 10, 2022
Follow-up to godotengine#64138, split from godotengine#62854.

`SubViewport` has some settings applied on initialization, and the side effects of these settings are delayed until it enters the tree.
@Rindbee
Copy link
Contributor Author

Rindbee commented Nov 20, 2022

Superseded by #68358.

@Rindbee Rindbee closed this Nov 20, 2022
@Rindbee Rindbee deleted the make-initialization-settings-take-effect-in-SubViewport branch November 20, 2022 08:52
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.

Vulkan: SubViewports not functioning unless update mode is set to "Always"
3 participants