-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Fix SubViewport not rendering correctly #62854
Fix SubViewport not rendering correctly #62854
Conversation
When the The parent |
Lines 727 to 736 in 836fe9a
Currently the default Of course, Given the close relationship between |
bac9797
to
aeb0f7c
Compare
UPDATE_WHEN_PARENT_VISIBLE, | ||
UPDATE_ALWAYS | ||
}; | ||
|
||
private: | ||
UpdateMode update_mode = UPDATE_WHEN_VISIBLE; | ||
UpdateMode update_mode = UPDATE_ONCE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UPDATE_ALWAYS
might be better, but I'm not sure if it's necessary.
…t changes as follows: 1. Size changed; 2. Enter/exit the tree. When the SubViewport enters the tree, some properties should also be set according to its parent.
aeb0f7c
to
f0f16c2
Compare
`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`).
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.
Fix #55471.
Previously, the necessary steps in
_set_size
were not performed when theSubViewport
was initialized, which caused rendering issues. There was no problem when changing the parameters (makesize
,size_2d_override
, orsize_2d_override_stretch
not the default value) which caused_set_size
to be called.