-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Update viewport scaling demo to 4.0. #891
Conversation
viewport/3d_scaling_compat/README.md
Outdated
|
||
Renderer: Compatibility | ||
|
||
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/586 |
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.
Do we need a new asset library entry?
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.
Yes. 4.0 demos haven't been submitted for the asset library yet, but we intend to keep the 3.x demos available for the foreseeable future.
In the meantime, you can remove the "Check out this demo on the asset library" line as it'll need to have its URL changed once the demo is submitted.
I've pushed additional commits to https://github.com/Calinou/godot-demo-projects/tree/rcorre-update-viewport-scaling-demos to improve the demos in various ways, but the 3D Resolution Scaling (Compatibility) demo needs to resize the SubViewport when the window size changes. Otherwise, 3D rendering becomes pixelated or blurry once you increase the window size (which is unexpected from an user perspective, as we're using the I haven't been able to figure this out yet because you can't change a SubViewport's size when Stretch is enabled on the parent SubViewportContainer. We may end up having to disable Stretch and implement scaling ourselves, similar to what the 3D in 2D demo does. |
Huh, I figured that would happen automatically with Stretch enabled. I added this print:
The viewport is resizing to the parent control, but the way the parent control resizes depends on the |
Idk if it's just me, but testing this on Godot 4.1.1.stable.custom_build on Steam Deck doesn't seem to do anything, it draws at the window resolution. I have this same problem in my project that emulates this subviewport project; and my project already handles size_changed. Oh I guess related to this: godotengine/godot#72548 |
godotengine/godot#83976 is landing in 4.3, so I'd prefer we just use the 3D scaling method for all rendering methods now. This way, there's only one way to achieve it in a way that doesn't lock you from switching rendering methods later on (or makes you use a suboptimal approach on Forward+/Mobile). The separate-viewport scaling method is still worth documenting for 2D usage, but it's more niche in comparison, so it should remain in its separate demo and should cover 2D rendering instead. This mean it would have to be redone from scratch. |
Fixes godotengine#856. The 3d_scaling demo was updated to use the built-in 3D scaling mechanisms in the Forward+ renderer. A new 3d_scaling_compat demo was added to demonstrate the legacy SubViewport-based scaling method for the Compatibility renderer. Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
I updated to only include the builtin scaling demo, and removed the 3D compat demo. |
Merged manually with 722bd11 (which includes some visual and UI improvements to make scaling more noticeable). Thanks! |
Fixes #856.
The 3d_scaling demo was updated to use the built-in 3D scaling mechanisms
in the Forward+ renderer.
A new 3d_scaling_compat demo was added to demonstrate the legacy
SubViewport-based scaling method for the Compatibility renderer.