-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Viewport doesn't update when ViewportContainer is Hidden #57901
Comments
Not quite a bug? If it's not visible, then it will not render. And with a ViewportContainer, it is assumed that you are not using it elsewhere. You can however force it to. https://docs.godotengine.org/en/stable/classes/class_viewport.html#class-viewport-method-update-worlds |
I think you can set the update mode to |
I don't know why this is closed since I clearly wrote: |
A minimal reproduction project would be good so that we can test and see if it's a bug or a misconfiguration. |
Added the project to the original post. Thanks for reminding me. I was at work and wasn't allowed to upload anything. |
ViewportContainer automatically changes update mode. |
If I recall correctly a viewport container always overrules the update mode of the subviewport, this was done because many people left the subviewport set to rendering even when the container was hidden. If you want to use the subviewport both shown as is, and as a texture on a 3D model, best not to use a subviewport but just display it on a textureRect. |
Closing as duplicate of #56502 |
Godot version
3.4.2.stable
System information
Windows 10, GLES3
Issue description
I've tried this in a 3D scene with a Control scene as a child (acting as overlay GUI).
Control scene has a TabContainer and one of the tabs has a ViewportContainer. ViewportContainer has a Viewport and the Viewport has a Camera (3D Camera).
The purpose is having a topview window in that tab.
I tried accessing the viewport.get_texture() in the main scene and saw that if I am showing another tab (ViewportContainer is not visible), the texture is not updated.
A simpler test I did was simply adding a ViewportContainer to my 3D scene and adding a sprite with ViewportTexture.
While running the game, if I hide the ViewportContainer in editor, the texture on the sprite stops updating.
I verified the Viewport render_target_update_mode is "Always" on both cases.
Steps to reproduce
Add a ViewportContainer with a viewport and camera to a 3D scene with some movement going on.
Add a sprite with ViewportTexture and show the viewport as target.
While running the game, hide the ViewportContainer in editor, you'll see the texture on the sprite stops updating.
Minimal reproduction project
EDIT: Created this issue at work and wasn't allowed to upload anything to internet there. Now the minimal project is added (after reminded by @akien-mga, so thanks :) )
minimal-viewport-update.zip
The text was updated successfully, but these errors were encountered: