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

SubViewport scaling not respecting override size for 3D #72548

Open
dragon1freak opened this issue Feb 1, 2023 · 4 comments
Open

SubViewport scaling not respecting override size for 3D #72548

dragon1freak opened this issue Feb 1, 2023 · 4 comments

Comments

@dragon1freak
Copy link

Godot version

v4.0.beta17.official [c400205]

System information

Windows 10, Vulkan, Nvidia 2080 Super

Issue description

When adding a 3D scene to a SubViewport and setting a Size 2D Override value with Size 2D Override Stretch enabled, the SubViewportContainer setting of Stretch is ignored by 3D unless the setting is changed during runtime. Canvas elements are unaffected and are shown at the correct resolution while 3D elements fit the viewport resolution.
image

If Stretch is disabled when running the program and is enabled during runtime, the 3D scene is rendered as expected.
image

Steps to reproduce

Create a 3D scene and add a SubViewportContainer and enable Stretch, then add a SubViewport as a child of the container. Add a mesh instance, a camera, and a canvas element like a label to the SubViewport. Set the Size 2D Override to a low resolution and enable Size 2D Override Stretch. When running the project, the 3D scene should be shown at the viewport resolution while any canvas items are shown at the expected size override resolution.

Stop running the scene, disable Stretch on the SubViewportContainer and run the project again. The viewport should fill only a small portion of the window. In the editor, enable the Stretch property and the scene should be rendered as expected.

Minimal reproduction project

SubViewportScalingIssue.zip

@akien-mga akien-mga added this to the 4.0 milestone Feb 1, 2023
@akien-mga
Copy link
Member

CC @Sauermann

@Sauermann
Copy link
Contributor

Sauermann commented Feb 2, 2023

This problem is even larger.
Physics Object picking is not working correctly, when enabling SubViewportContainer.stretch during runtime in the above MRP.

related to #62041
related to #61301

@voylin
Copy link
Contributor

voylin commented Feb 25, 2023

Been experiencing related issues whilst trying to get 3D scaling to work. Is this something which will be fixed by the 4.0 release or will this require more time and be for a later fix release? I don't have anytime to look into this problem myself but if this isn't for the 4.0 release than I may be able to work on this in a couple of weeks when time becomes available again.

@Sauermann
Copy link
Contributor

@voylin My suggested approach of how to solve this problem is detailed in godotengine/godot-proposals#6221. Since this is a larger change, it will not make it into 4.0.
I am not aware of other attempts to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants